Re: [PATCH 2/3] push: fail early with detached HEAD and current

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ramkumar Ramachandra <artagnon@xxxxxxxxx> writes:

> Junio C Hamano wrote:
>>>       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]?

By doing something like this, perhaps?

	struct ... branch;

        switch (...) {
        ...
        case it-only-matters-here:
        	branch = branch_get(NULL);
                if (!branch)
			die(...);
	}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]