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.