Fix intermittent 'branch not found' errors when pushing creates an MR
When we push to create a merge request (-omr.create), we kick off an asynchronous `PostReceive` worker job, then synchronously create a merge request. This requires the target branch (but not the source branch) to exist in the repository, so we check when validating the push options. The `PostReceive` worker invalidates the branch name cache, but does so asynchronously, so we may race with it. Until it is invalidated, the target branch may appear as if it doesn't exist, so we should instead explicitly invalidate it for ourselves. This is just dead reckoning at the moment, and is unlikely to solve cases where the target branch is the project's default branch, but it seems worth fixing to me. Changelog: fixed
Showing
Please register or sign in to comment