Re: [PATCH] branch: make --show-current use already resolved HEAD

2018-11-07 Thread Rafael Ascensão
I did something that resulted in the mailing list not being cc'd. Apologies to Junio and Daniels for the double send. :( On Thu, Nov 08, 2018 at 10:11:02AM +0900, Junio C Hamano wrote: > I'd prefer to see scriptors avoid using "git branch", too. > > Unlike end-user facing documentation where we

Re: [PATCH] branch: make --show-current use already resolved HEAD

2018-11-07 Thread Junio C Hamano
Rafael Ascensão writes: > print_current_branch_name() tries to resolve HEAD and die() when it > doesn't resolve it successfully. But the conditions being tested are > always unreachable because early in branch:cmd_branch() the same logic > is performed. > > Eliminate the duplicate and

[PATCH] branch: make --show-current use already resolved HEAD

2018-11-07 Thread Rafael Ascensão
print_current_branch_name() tries to resolve HEAD and die() when it doesn't resolve it successfully. But the conditions being tested are always unreachable because early in branch:cmd_branch() the same logic is performed. Eliminate the duplicate and unreachable code, and update the current logic