Re: [PATCH v4 2/2] http-fetch: redact url on die() message
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2021, 23:18 UTC
- Message-ID
- <xmqqpmrnfmiv.fsf@gitster.g>
- In-Reply-To
- <211028.86sfwlw10o.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 6 quoted lines
>> + if (!git_env_bool("GIT_TRACE_REDACT", 1) || !nurl) {
>> + die("Unable to get pack file %s\n%s", preq->url,
>> + curl_errorstr);
>
> small nit: arrange if's from "if (cheap || expensive)", i.e. no need for
> getenv() if !nurl, but maybe compilers are smart enough for that...They typically do not see what happens inside git_env_bool() while compling this compilation unit, and cannot tell if the programmer wanted to call it first for its side effects, hence they cannot swap them safely.