Skip to content

Use create_branch instead of fetch_source_branch when importing MRs

What does this MR do?

A minor cleanup I noticed while investigating #12643 (closed)

This is a no-op in practice; if the SHA already exists in the target repository, Gitaly skips the "fetch the ref from the source repository" logic and does a write_ref(sha, path) call: https://gitlab.com/gitlab-org/gitlab/blob/master/ruby/lib/gitlab/git/repository.rb#L512 .

Since in this call, the source repository is the same as the target repository, we get absolutely no benefit from using fetch_source_branch here.

It's good to express our intentions as directly as possible, though.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Nick Thomas

Merge request reports