summaryrefslogtreecommitdiff
path: root/app/services/git_operation_service.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-12-14 03:00:16 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-12-14 03:00:16 +0800
commit944a8fa4d204ce7e9967f372a61657e75b4e88a0 (patch)
treea053bd45ff99b1997ec49d77495aba0bcbeda567 /app/services/git_operation_service.rb
parentd03c605bd4a128d45179dd05f117a78aab7af6be (diff)
downloadgitlab-ce-944a8fa4d204ce7e9967f372a61657e75b4e88a0.tar.gz
Use branch_exists? to check branches
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_19747922
Diffstat (limited to 'app/services/git_operation_service.rb')
-rw-r--r--app/services/git_operation_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/git_operation_service.rb b/app/services/git_operation_service.rb
index 68b28231595..b00fbcf9a79 100644
--- a/app/services/git_operation_service.rb
+++ b/app/services/git_operation_service.rb
@@ -150,14 +150,14 @@ class GitOperationService
' :source_project is different from current project'
end
- unless source_project.repository.commit(source_branch_name).try(:sha)
+ unless source_project.repository.branch_exists?(source_branch_name)
raise Repository::CommitError.new(
"Cannot find branch #{branch_name} nor" \
" #{source_branch_name} from" \
" #{source_project.path_with_namespace}")
end
elsif source_branch_name
- unless repository.commit(source_branch_name).try(:sha)
+ unless repository.branch_exists?(source_branch_name)
raise Repository::CommitError.new(
"Cannot find branch #{branch_name} nor" \
" #{source_branch_name} from" \