Commit 54d64ec9 authored by Stan Hu's avatar Stan Hu Committed by Oswaldo Ferreira

Remove source_branch_name commit check

This should already be done in Gitlab::Git:Compare.
parent 26653eb0
......@@ -733,8 +733,6 @@ module Gitlab
def compare_source_branch(target_branch_name, source_repository, source_branch_name, straight:)
if source_repository == self
return unless commit(source_branch_name).present?
return Gitlab::Git::Compare.new(self, target_branch_name, source_branch_name, straight: straight)
end
......
......@@ -1980,7 +1980,7 @@ describe Gitlab::Git::Repository, :seed_helper do
it 'returns nil when source ref does not exist' do
compare = repository.compare_source_branch('master', repository, 'non-existent-branch', straight: false)
expect(compare).to be_nil
expect(compare.commits).to be_empty
end
end
......
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