diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-04-23 09:31:39 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-04-23 09:31:39 +0000 |
commit | f59ea61bc8636e2f49c67058db7939eed8febb10 (patch) | |
tree | 840a4ddc0842fc0ef2210d36893ca1bfe61e9b13 /app | |
parent | 1f1ac58d80372d80bbdb4501bad5e9ac84b98ef5 (diff) | |
parent | 976d373ac1dbe2c0584b254492c6bd8fac738b65 (diff) | |
download | gitlab-ce-f59ea61bc8636e2f49c67058db7939eed8febb10.tar.gz |
Merge branch 'sh-avoid-fetching-temp-refs-within-project' into 'master'
Don't create a temp reference for branch comparisons within project
Closes #58315
See merge request gitlab-org/gitlab-ce!24038
Diffstat (limited to 'app')
-rw-r--r-- | app/services/compare_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/compare_service.rb b/app/services/compare_service.rb index 3adf8a0c1a1..3f0aedfbfb2 100644 --- a/app/services/compare_service.rb +++ b/app/services/compare_service.rb @@ -3,7 +3,7 @@ require 'securerandom' # Compare 2 refs for one repo or between repositories -# and return Gitlab::Git::Compare object that responds to commits and diffs +# and return Compare object that responds to commits and diffs class CompareService attr_reader :start_project, :start_ref_name @@ -15,7 +15,7 @@ class CompareService def execute(target_project, target_ref, base_sha: nil, straight: false) raw_compare = target_project.repository.compare_source_branch(target_ref, start_project.repository, start_ref_name, straight: straight) - return unless raw_compare + return unless raw_compare && raw_compare.base && raw_compare.head Compare.new(raw_compare, target_project, |