lib/gitlab_git/repository.rb in gitlab_git-7.2.5 vs lib/gitlab_git/repository.rb in gitlab_git-7.2.6
- old
+ new
@@ -425,12 +425,15 @@
# Initialize only when first call
if @refs_hash.nil?
@refs_hash = Hash.new { |h, k| h[k] = [] }
rugged.references.each do |r|
- sha = rev_parse_target(r.target.oid).oid
-
- @refs_hash[sha] << r
+ # Symbolic/remote references may not have an OID; skip over them
+ target_oid = r.target.try(:oid)
+ if target_oid
+ sha = rev_parse_target(target_oid).oid
+ @refs_hash[sha] << r
+ end
end
end
@refs_hash
end