Skip to content

Commit ef34a34

Browse files
authored
Merge pull request #1889 from tyrielv/tyrielv/fix-head-tree-id
Fix GetHeadTreeId to only read head commit
2 parents f877d10 + 3cb5290 commit ef34a34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

GVFS/GVFS.Common/Git/GitProcess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ public Result MultiPackIndexRepack(string gitObjectDirectory, string batchSize)
684684

685685
public Result GetHeadTreeId()
686686
{
687-
return this.InvokeGitAgainstDotGitFolder("show -s --format=%T HEAD", usePreCommandHook: false);
687+
return this.InvokeGitAgainstDotGitFolder("rev-parse \"HEAD^{tree}\"", usePreCommandHook: false);
688688
}
689689

690690
public Process GetGitProcess(string command, string workingDirectory, string dotGitDirectory, bool useReadObjectHook, bool redirectStandardError, string gitObjectsDirectory, bool usePreCommandHook)

GVFS/GVFS.UnitTests/Common/EnlistmentHydrationSummaryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void HeadTreeCountCacheTests((string CachePrecontents, string ExpectedCac
100100
this.enlistmentDirectory.CreateFile(totalPathCountPath, args.CachePrecontents, createDirectories: true);
101101
}
102102

103-
this.gitProcess.SetExpectedCommandResult("show -s --format=%T HEAD",
103+
this.gitProcess.SetExpectedCommandResult("rev-parse \"HEAD^{tree}\"",
104104
() => new GitProcess.Result(HeadTreeId, "", 0));
105105
this.gitProcess.SetExpectedCommandResult("ls-tree -r -d HEAD",
106106
() => new GitProcess.Result(

0 commit comments

Comments
 (0)