Skip to content
Snippets Groups Projects
Commit 8334ab21 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Merge branch 'compare-commits-on-nil-refs' into 'master'

Compare returns an empty collection of commits on nil refs

See merge request !114
parents 20e42da4 83b7fec6
No related branches found
No related tags found
1 merge request!114Compare returns an empty collection of commits on nil refs
Pipeline #
v 10.4.5
- Write .gitattributes in binary mode to prevent Rails from converting ASCII-8BIT to UTF-8
- Compare returns an empty collection of commits on nil refs
 
v 10.4.4
- Lazy load compare commits
Loading
Loading
Loading
Loading
@@ -6,7 +6,10 @@ module Gitlab
def initialize(repository, base, head)
@repository = repository
 
return unless base && head
unless base && head
@commits = []
return
end
 
@base = Gitlab::Git::Commit.find(repository, base.try(:strip))
@head = Gitlab::Git::Commit.find(repository, head.try(:strip))
Loading
Loading
Loading
Loading
@@ -32,6 +32,12 @@ describe Gitlab::Git::Compare do
 
it { is_expected.to be_empty }
end
context 'providing nil as base ref or head ref' do
let(:compare) { Gitlab::Git::Compare.new(repository, nil, nil) }
it { is_expected.to be_empty }
end
end
 
describe :diffs do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment