зеркало из https://github.com/microsoft/git.git
refs_ref_iterator_begin(): handle `GIT_REF_PARANOIA`
Instead of handling `GIT_REF_PARANOIA` in `files_ref_iterator_begin()`, handle it in `refs_ref_iterator_begin()`, where it will cover all reference stores. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
89c571da56
Коммит
0a0865b8f1
5
refs.c
5
refs.c
|
@ -1259,6 +1259,11 @@ struct ref_iterator *refs_ref_iterator_begin(
|
|||
{
|
||||
struct ref_iterator *iter;
|
||||
|
||||
if (ref_paranoia < 0)
|
||||
ref_paranoia = git_env_bool("GIT_REF_PARANOIA", 0);
|
||||
if (ref_paranoia)
|
||||
flags |= DO_FOR_EACH_INCLUDE_BROKEN;
|
||||
|
||||
iter = refs->be->iterator_begin(refs, prefix, flags);
|
||||
|
||||
/*
|
||||
|
|
|
@ -1074,15 +1074,12 @@ static struct ref_iterator *files_ref_iterator_begin(
|
|||
struct ref_iterator *loose_iter, *packed_iter;
|
||||
struct files_ref_iterator *iter;
|
||||
struct ref_iterator *ref_iterator;
|
||||
unsigned int required_flags = REF_STORE_READ;
|
||||
|
||||
if (ref_paranoia < 0)
|
||||
ref_paranoia = git_env_bool("GIT_REF_PARANOIA", 0);
|
||||
if (ref_paranoia)
|
||||
flags |= DO_FOR_EACH_INCLUDE_BROKEN;
|
||||
if (!(flags & DO_FOR_EACH_INCLUDE_BROKEN))
|
||||
required_flags |= REF_STORE_ODB;
|
||||
|
||||
refs = files_downcast(ref_store,
|
||||
REF_STORE_READ | (ref_paranoia ? 0 : REF_STORE_ODB),
|
||||
"ref_iterator_begin");
|
||||
refs = files_downcast(ref_store, required_flags, "ref_iterator_begin");
|
||||
|
||||
iter = xcalloc(1, sizeof(*iter));
|
||||
ref_iterator = &iter->base;
|
||||
|
|
Загрузка…
Ссылка в новой задаче