Skip to content

Fix inconsistent `branch?` behavior between Ci::Pipeline and Ci::Build

Shinya Maeda requested to merge fix-inconsistent-behavior-of-has-ref into master

What does this MR do?

This causes a bug in this code in BuildRunnerPresenter.

      specs << refspec_for_merge_request if merge_request?

      if git_depth > 0
        specs << refspec_for_branch(ref) if branch?
        specs << refspec_for_tag(ref) if tag?
      else

branch? becomes true even if it's a merge request pipeline.

(See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25504/diffs#5e6648f1984124a2bf534ed01af999547847e436_37_39)

What are the relevant issue numbers?

Related: https://gitlab.com/gitlab-org/gitlab-ee/issues/7380

Does this MR meet the acceptance criteria?

Edited by Kamil Trzciński

Merge request reports