diff --git a/GVFS/GVFS.Common/Git/GitProcess.cs b/GVFS/GVFS.Common/Git/GitProcess.cs index 616d0ec22..a86b6131a 100644 --- a/GVFS/GVFS.Common/Git/GitProcess.cs +++ b/GVFS/GVFS.Common/Git/GitProcess.cs @@ -684,7 +684,7 @@ public Result MultiPackIndexRepack(string gitObjectDirectory, string batchSize) public Result GetHeadTreeId() { - return this.InvokeGitAgainstDotGitFolder("show -s --format=%T HEAD", usePreCommandHook: false); + return this.InvokeGitAgainstDotGitFolder("rev-parse \"HEAD^{tree}\"", usePreCommandHook: false); } public Process GetGitProcess(string command, string workingDirectory, string dotGitDirectory, bool useReadObjectHook, bool redirectStandardError, string gitObjectsDirectory, bool usePreCommandHook) diff --git a/GVFS/GVFS.UnitTests/Common/EnlistmentHydrationSummaryTests.cs b/GVFS/GVFS.UnitTests/Common/EnlistmentHydrationSummaryTests.cs index 53591de8a..2623dc4bd 100644 --- a/GVFS/GVFS.UnitTests/Common/EnlistmentHydrationSummaryTests.cs +++ b/GVFS/GVFS.UnitTests/Common/EnlistmentHydrationSummaryTests.cs @@ -100,7 +100,7 @@ public void HeadTreeCountCacheTests((string CachePrecontents, string ExpectedCac this.enlistmentDirectory.CreateFile(totalPathCountPath, args.CachePrecontents, createDirectories: true); } - this.gitProcess.SetExpectedCommandResult("show -s --format=%T HEAD", + this.gitProcess.SetExpectedCommandResult("rev-parse \"HEAD^{tree}\"", () => new GitProcess.Result(HeadTreeId, "", 0)); this.gitProcess.SetExpectedCommandResult("ls-tree -r -d HEAD", () => new GitProcess.Result(