Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
674b926e
Commit
674b926e
authored
Apr 09, 2019
by
John Cai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guard against nil dereferenced_target
parent
9d7ff90d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
changelogs/unreleased/jc-guard-against-empty-dereferenced_target.yml
...unreleased/jc-guard-against-empty-dereferenced_target.yml
+5
-0
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+1
-1
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+7
-0
No files found.
changelogs/unreleased/jc-guard-against-empty-dereferenced_target.yml
0 → 100644
View file @
674b926e
---
title
:
Guard against nil dereferenced_target
merge_request
:
27192
author
:
type
:
fixed
lib/gitlab/git/repository.rb
View file @
674b926e
...
...
@@ -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
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
674b926e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment