Открыть боковую панель
nt_test111
nt_project_u8hcxr42ygkw
Коммиты
674b926e
Коммит
674b926e
создал
Апр 09, 2019
по автору
John Cai
Просмотр файлов
Guard against nil dereferenced_target
владелец
9d7ff90d
Изменения
3
Скрыть пробелы
Построчно
Рядом
changelogs/unreleased/jc-guard-against-empty-dereferenced_target.yml
0 → 100644
Просмотр файла @
674b926e
---
title
:
Guard against nil dereferenced_target
merge_request
:
27192
author
:
type
:
fixed
lib/gitlab/git/repository.rb
Просмотр файла @
674b926e
...
...
@@ -466,7 +466,7 @@ def refs_hash
@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
Просмотр файла @
674b926e
...
...
@@ -531,6 +531,13 @@ def submodule_url(path)
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
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать