Re: [PATCH v14 13/27] bisect--helper: `bisect_start` shell function partially in C
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 27, 2016, 20:53 UTC
- Message-ID
- <xmqqzinyc4s6.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAFZEwPMotQ1k0EZN-buEt9MhJUKhXLS8eB5zV5A3Qr-j=DEwfQ@mail.gmail.com>
Pranit Bauva <pranit.bauva@gmail.com> writes:
Show 14 quoted lines
>> I wonder the whole thing above is better restructured to avoid
>> repeated checks of the same thing.
>>
>> if (is it 40-hex, i.e. detached?) {
>> stuff it to start_head;
>> } else if (skip_prefix(head, "refs/heads/", &branchname)) {
>> do the "cogito" check;
>> stuff it to start_head;
>> } else {
>> that's a strange symbolic ref HEAD you have there;
>> }
>
> I guess it changes the behaviour. Its a strange symbolic ref if it
> does not start with "refs/heads".I did not think my suggestion would change the behaviour at all. It would change the code structure a bit to make it more readable, though.