Commit 937bd9e3 authored by Mark Chao's avatar Mark Chao

Fix possiblilty of branch not found

This now can happen because can_be_merged? is called
during MR merge_status transition to cannot_be_merged.
It is possible branch_name is invalid.
parent 5b994b81
......@@ -1413,8 +1413,11 @@ module Gitlab
end
def can_be_merged?(source_sha, target_branch)
target_sha = find_branch(target_branch, true).target
if target_sha = find_branch(target_branch, true)&.target
!gitaly_conflicts_client(source_sha, target_sha).conflicts?
else
false
end
end
def search_files_by_name(query, ref)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment