Subject: Re: [PATCH] builtin/show-ref.c: avoid over-iterating with --heads, --tags

From: Junio C Hamano <[email-masked]>
Date: Mon, 06 Jun 2022 10:07:40 -0700

Derrick Stolee <[email-masked]> writes:

>> -	for_each_ref(show_ref, NULL);
>> +	if (heads_only || tags_only) {
>> +		if (heads_only)
>> +			for_each_fullref_in("refs/heads/", show_ref, NULL);
>> +		if (tags_only)
>> +			for_each_fullref_in("refs/tags/", show_ref, NULL);
>
> This looks a little silly if these were truly "only" (they
> could not both be true), but indeed they could both be true
> and the names are just slightly misleading.
>
> Indeed, t1403-show-ref.sh tests all combinations of these
> options.

Hmph, that is right. show-heads and show-tags, perhaps.

Thanks, both.  Queued.