Re: What's cooking in git.git (Apr 2020, #01; Wed, 15)

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

 



Damien Robert <damien.olivier.robert@xxxxxxxxx> writes:

> The difference in remote_get_1 is that
> 	name_given = 1;
> So
> 	if (name_given && !valid_remote(ret))
> 		add_url_alias(ret, name);
> gets called.

Ah, of course ;-) The code in builtin/push.c rely on being able to
pass NULL as the name and rely on current branch getting used; you
have to pass the name of the ref you are trying to format %(push)
for, so you would trigger add_url_alias(), which says as a fallback
that URL for "origin" is "origin" and makes ret->url non-NULL (hence
it no longer is !valid_remote() and gets returned).  

Geez.  This is tricky.

> But I think that means that my fixup is actually wrong when a pushRemote is
> set without a remote while 'origin' do exist.

Thanks.



[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]

  Powered by Linux