Skip to content

Commit d93e268

Browse files
Merge pull request #1131: PostFetchStep: delete and rewrite commit-graph on write error
We are no longer using 'verify' to check that our commit-graph is valid, but we can still discover some errors during the 'write' command. We currently never recover from this problem. If we inspect the response from the 'write' command, then we can delete and rewrite on failure. This will resolve some issues that users are seeing right now.
2 parents d8d61c4 + 2e5df30 commit d93e268

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

GVFS/GVFS.Common/Maintenance/PostFetchStep.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ protected override void PerformMaintenance()
4646
string commitGraphLockPath = Path.Combine(this.Context.Enlistment.GitObjectsRoot, "info", CommitGraphLock);
4747
this.Context.FileSystem.TryDeleteFile(commitGraphLockPath);
4848

49-
this.RunGitCommand((process) => process.WriteCommitGraph(this.Context.Enlistment.GitObjectsRoot, this.packIndexes), nameof(GitProcess.WriteCommitGraph));
49+
GitProcess.Result writeResult = this.RunGitCommand((process) => process.WriteCommitGraph(this.Context.Enlistment.GitObjectsRoot, this.packIndexes), nameof(GitProcess.WriteCommitGraph));
50+
51+
if (writeResult.ExitCodeIsFailure)
52+
{
53+
this.LogErrorAndRewriteCommitGraph(activity, this.packIndexes);
54+
}
5055

5156
// Turning off Verify for commit graph due to performance issues.
5257
/*

0 commit comments

Comments
 (0)