Skip to content

remote: add tests for F/D conflicts in UpdateRemoteMirror

Karthik Nayak requested to merge kn-4389-repo-mirroring-df-conflicts into master

When fetching refs from a source, there is a potential F/D conflict which can occur. Consider the following:

  1. Source => {refs: ["refs/heads/branch": commit1]}
  2. Mirror => {refs: ["refs/heads/branch/conflict": commit2]}

When we pull the refs from the source to the mirror, there is potential scenario where there is a F/D conflict.

In UpdateRemoteMirror we only prune unwanted refs before the fetch if we know that the commit the ref is pointing at is an ancestor of one of the incoming refs. This allows us to retain commit from being pruned because we deleted the ref.

Because of this, the F/D conflict will only occur in UpdateRemoteMirror in the latter scenario. This is the expected behavior, but let's add tests to capture this.

Part of #4389 (comment 1231874502)

Edited by Karthik Nayak

Merge request reports