-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use index.lock and move writes to head and refs to the end of the run to make interrupted fastfetch operations less bad #1763
Conversation
As mentioned in the comments, FastFetch is pretty far away from the ideal way of handling .git/index and .git/index.lock. I had a go at fixing that, but after getting a ways into it, I decided that the value just wasn't really there and the risk was pretty high. So I hacked around the problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simplify this just a tiny bit more. What do you think?
GVFS/FastFetch/CheckoutPrefetcher.cs
Outdated
@@ -72,87 +72,104 @@ public override void Prefetch(string branchOrCommit, bool isBranch) | |||
commitToFetch = branchOrCommit; | |||
} | |||
|
|||
this.DownloadMissingCommit(commitToFetch, this.GitObjects); | |||
if (!IndexLock.TryGetLock(this.Enlistment.EnlistmentRoot, this.Tracer, out var indexLock)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to any other reviewers: this diff looks a lot better if you change the diff options to "Hide Whitespace".
…ng to pass on pass-fail information to future instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for answering my questions!
No description provided.