summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-11-21 09:12:41 +0000
committerRémy Coutable <remy@rymai.me>2016-11-21 09:12:41 +0000
commit900999f8180e49aa1677286e3e0cfa08d47829a7 (patch)
tree102df693cc4077f8fb806f9eda382c778e25df54 /app
parent9aded5c8d43cf113b03e2d8fd04a32c4b24af24d (diff)
parent16a8d6442928b6909e4421430f4bfc9b725c1bc9 (diff)
downloadgitlab-ce-900999f8180e49aa1677286e3e0cfa08d47829a7.tar.gz
Merge branch '24627-fix-bad-mr-error-message' into 'master'
Fixes regression causing an error message to appear when user first enters the Merge Request form. Closes #24627 See merge request !7599
Diffstat (limited to 'app')
-rw-r--r--app/services/merge_requests/build_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb
index f415244068b..dd0d738674e 100644
--- a/app/services/merge_requests/build_service.rb
+++ b/app/services/merge_requests/build_service.rb
@@ -48,11 +48,11 @@ module MergeRequests
end
# See if source and target branches exist
- unless merge_request.source_project.commit(merge_request.source_branch)
+ if merge_request.source_branch.present? && !merge_request.source_project.commit(merge_request.source_branch)
messages << "Source branch \"#{merge_request.source_branch}\" does not exist"
end
- unless merge_request.target_project.commit(merge_request.target_branch)
+ if merge_request.target_branch.present? && !merge_request.target_project.commit(merge_request.target_branch)
messages << "Target branch \"#{merge_request.target_branch}\" does not exist"
end