Adrian pushed the commit directly, that contained the change I missed above.
This version dropped the one from common/git_utils.go , please add it back.
Looks good. Please remove the wip, once you are ready. Inline comments can be addressed later.
Probably a good idea to add a merge --abort here, too, even if I don't know if that ever matters.
Can be done later: There is no unit test for this code path, would be worth it.
The improved update logic from this PR is still needed, should be rebased on top of git-workflow/autogits#167 .
This can be addressed in a follow up: Maybe this should be unconditional, as it would be a bit more work to know which error means something has changed despite the error and which error means there was a conflict and we need to invalidate anyway.
I have not yet reviewed the PR lock and requeue part. Everything else looks good. Additionally to this PR we should also reopen git-workflow/autogits#155 for the fix in how to update the cache, though that is independent.