diff options
author | Robert Speicher <robert@gitlab.com> | 2018-06-20 19:13:28 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-06-20 19:13:28 +0000 |
commit | a8f4f48e4ad0283e4542b36b10a3edebf1e700a0 (patch) | |
tree | d155c00b6544c6b32bdf4ec034726228ca62df8c /lib | |
parent | 1a426b040f3cef46dd63a54afcb65404b18ebfc6 (diff) | |
parent | 937bd9e386f54eeac2ef2009173d58a7842f9779 (diff) | |
download | gitlab-ce-a8f4f48e4ad0283e4542b36b10a3edebf1e700a0.tar.gz |
Merge branch '47488-remove-unmergeable-notification-for-no-commits' into 'master'
Notify only merge request unmergeable due to conflict
See merge request gitlab-org/gitlab-ce!19548
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/repository.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 77543206e13..b7965315eb2 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1413,8 +1413,11 @@ module Gitlab end def can_be_merged?(source_sha, target_branch) - target_sha = find_branch(target_branch, true).target - !gitaly_conflicts_client(source_sha, target_sha).conflicts? + 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) |