Re: [PATCH v2 01/10] refs: allow "HEAD" as decoration filter
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 3, 2022, 06:03 UTC
- Message-ID
- <xmqqedxxeued.fsf@gitster.g>
- In-Reply-To
- <c2e5a0b3a50237f3b7f5ceb5d05faa83fd41de68.1659122979.git.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> if (prefix) {
> strbuf_addstr(&normalized_pattern, prefix);
> - }
> - else if (!starts_with(pattern, "refs/"))
> + } else if (!starts_with(pattern, "refs/") &&
> + strcmp(pattern, "HEAD"))Perhaps leave a needswork comment to remind us to later consider covering all the pseudorefs like MERGE_HEAD, CHERRY_PICK_HEAD etc.?
> strbuf_addstr(&normalized_pattern, "refs/");
Style:
If you plan to add more code to the bodies of this if/elseif, then have {} around all arms. Otherwise, let's lose the {} around the body of "if (prefix)".