diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-05-22 16:17:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-23 14:29:56 +0900 |
commit | 0a0865b8f168b7195bd15440d15eb0e7817d6526 (patch) | |
tree | dee1590290a4dc1eb23a5729d37967041d151278 /refs | |
parent | 89c571da56a1e84fe12308f727fac0e82c1d5be6 (diff) | |
download | git-0a0865b8f168b7195bd15440d15eb0e7817d6526.tar.gz git-0a0865b8f168b7195bd15440d15eb0e7817d6526.tar.xz |
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>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/files-backend.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index dbfd03f98..5de36fc33 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -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; |