Re: [PATCH 2/3] push: fail early with detached HEAD and current
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- May 29, 2013, 19:37 UTC
- Message-ID
- <CALkWK0mCY0F-EgO6hQv-LvV1Nb5H9jNXBWLDrY07rVNqLBPjkw@mail.gmail.com>
- In-Reply-To
- <7vppw9shq2.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 12 quoted lines
>> case PUSH_DEFAULT_CURRENT:
>> + if (!branch)
>> + die(_(message_detached_head_die), remote->name);
>> add_refspec("HEAD");
>> break;
>
> Would it hurt to do
>
> if (!branch_get(NULL))
> die(...);
>
> here, without the first hunk?And how would I change the add_refspec() call to take branch->name in [3/3]?