Re: [PATCH 2/5] refs: introduce a "ref paranoia" flag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 19, 2015, 20:13 UTC
- Message-ID
- <xmqqbnjoiw4m.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150317072957.GB25191@peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> diff --git a/refs.c b/refs.c
> index e23542b..7f0e7be 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -1934,6 +1934,11 @@ static int do_for_each_ref(struct ref_cache *refs, const char *base,
> data.fn = fn;
> data.cb_data = cb_data;
>
> + if (ref_paranoia < 0)
> + ref_paranoia = git_env_bool("GIT_REF_PARANOIA", 0);
> + if (ref_paranoia)
> + data.flags |= DO_FOR_EACH_INCLUDE_BROKEN;I am not a big fan of proliferation of interfaces based on environment variables, but hopefully this is isolated enough to become an issue in the future.
> + > return do_for_each_entry(refs, base, do_one_ref, &data); > }