summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-04-11 07:45:48 +0000
committerSean McGivern <sean@gitlab.com>2019-04-11 07:45:48 +0000
commitdd019c2e0b6e292fb55ed264c430eec4a13c0c6b (patch)
tree285b17b0b62aab22f71e4661e88dfda083de4040 /lib
parentcd770031736419c142990d7474a98b835ac97a92 (diff)
parent674b926ef4dd48146be7fa8a8c37861b285bbe3b (diff)
downloadgitlab-ce-dd019c2e0b6e292fb55ed264c430eec4a13c0c6b.tar.gz
Merge branch 'jc-guard-against-empty-dereferenced_target' into 'master'
Guard against nil dereferenced_target Closes #60076 See merge request gitlab-org/gitlab-ce!27192
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/repository.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index c33d243330d..a22e3c4b9dd 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -466,7 +466,7 @@ module Gitlab
@refs_hash = Hash.new { |h, k| h[k] = [] }
(tags + branches).each do |ref|
- next unless ref.target && ref.name
+ next unless ref.target && ref.name && ref.dereferenced_target&.id
@refs_hash[ref.dereferenced_target.id] << ref.name
end