diff --git a/GVFS/GVFS.Common/FileSystem/HooksInstaller.cs b/GVFS/GVFS.Common/FileSystem/HooksInstaller.cs index aaa3cc1010..a46c45781b 100644 --- a/GVFS/GVFS.Common/FileSystem/HooksInstaller.cs +++ b/GVFS/GVFS.Common/FileSystem/HooksInstaller.cs @@ -1,4 +1,5 @@ -using GVFS.Common.Tracing; +using GVFS.Common.Git; +using GVFS.Common.Tracing; using System; using System.Collections.Generic; using System.Diagnostics; @@ -26,7 +27,13 @@ public static string MergeHooksData(string[] defaultHooksLines, string filename, { IEnumerable valuableHooksLines = defaultHooksLines.Where(line => !string.IsNullOrEmpty(line.Trim())); - if (!valuableHooksLines.Any()) + if (valuableHooksLines.Contains(GVFSPlatform.Instance.Constants.GVFSHooksExecutableName, StringComparer.OrdinalIgnoreCase)) + { + throw new HooksConfigurationException( + $"{GVFSPlatform.Instance.Constants.GVFSHooksExecutableName} should not be specified in the configuration for " + + GVFSConstants.DotGit.Hooks.ReadObjectName + " hooks (" + filename + ")."); + } + else if (!valuableHooksLines.Any()) { return GVFSPlatform.Instance.Constants.GVFSHooksExecutableName; } diff --git a/GVFS/GVFS.Common/InstallerPreRunChecker.cs b/GVFS/GVFS.Common/InstallerPreRunChecker.cs index 6587263b6f..295c9091d5 100644 --- a/GVFS/GVFS.Common/InstallerPreRunChecker.cs +++ b/GVFS/GVFS.Common/InstallerPreRunChecker.cs @@ -1,5 +1,4 @@ using GVFS.Common; -using GVFS.Common.Git; using GVFS.Common.Tracing; using System; using System.Collections.Generic; @@ -196,7 +195,7 @@ private bool IsGVFSUpgradeAllowed(out string consoleError) Environment.NewLine, $"{GVFSConstants.UpgradeVerbMessages.GVFSUpgrade} is only supported after the \"Windows Projected File System\" optional feature has been enabled by a manual installation of VFS for Git, and only on versions of Windows that support this feature.", "Check your team's documentation for how to upgrade."); - this.tracer.RelatedWarning(metadata: null, message:$"{nameof(this.IsGVFSUpgradeAllowed)}: Upgrade is not installable. {consoleError}", keywords: Keywords.Telemetry); + this.tracer.RelatedWarning(metadata: null, message: $"{nameof(this.IsGVFSUpgradeAllowed)}: Upgrade is not installable. {consoleError}", keywords: Keywords.Telemetry); return false; } diff --git a/GVFS/GVFS/CommandLine/GVFSVerb.cs b/GVFS/GVFS/CommandLine/GVFSVerb.cs index 6605943fda..3a25369614 100644 --- a/GVFS/GVFS/CommandLine/GVFSVerb.cs +++ b/GVFS/GVFS/CommandLine/GVFSVerb.cs @@ -131,6 +131,7 @@ public static bool TrySetRequiredGitConfigSettings(Enlistment enlistment) { "core.untrackedCache", "false" }, { "core.repositoryformatversion", "0" }, { "core.filemode", GVFSPlatform.Instance.FileSystem.SupportsFileMode ? "true" : "false" }, + { GitConfigSetting.CoreVirtualizeObjectsName, "true" }, { "core.bare", "false" }, { "core.logallrefupdates", "true" }, { "core.hookspath", expectedHooksPath },