summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2019-04-09 17:31:20 -0700
committerJohn Cai <jcai@gitlab.com>2019-04-10 11:39:36 -0700
commit674b926ef4dd48146be7fa8a8c37861b285bbe3b (patch)
tree0a51b6c99e31091adb8af5add50ce2643652f20e /spec
parent9d7ff90d9a7bd9dbe9184c9588510f247877274f (diff)
downloadgitlab-ce-674b926ef4dd48146be7fa8a8c37861b285bbe3b.tar.gz
Guard against nil dereferenced_targetjc-guard-against-empty-dereferenced_target
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index fdb43d1221a..778950c95e4 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -531,6 +531,13 @@ describe Gitlab::Git::Repository, :seed_helper do
it 'has valid commit ids as keys' do
expect(subject.keys).to all( match(Commit::COMMIT_SHA_PATTERN) )
end
+
+ it 'does not error when dereferenced_target is nil' do
+ blob_id = repository.blob_at('master', 'README.md').id
+ repository_rugged.tags.create("refs/tags/blob-tag", blob_id)
+
+ expect { subject }.not_to raise_error
+ end
end
describe '#fetch_repository_as_mirror' do