You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the value of %(push:remoteref) only handles the case when an
explicit push refspec is passed. But it does not handle the fallback
cases of looking at the configuration value of `push.default`.
In particular, doing something like
git config push.default current
git for-each-ref --format='%(push)'
git for-each-ref --format='%(push:remoteref)'
prints a useful tracking ref for the first for-each-ref, but an empty
string for the second.
Since the intention of %(push:remoteref), from 9700fae (for-each-ref:
let upstream/push report the remote ref name) is to get exactly which
branch `git push` will push to, even in the fallback cases, fix this.
To get the meaning of %(push:remoteref), `ref-filter.c` calls
`remote_ref_for_branch`. We simply add a new static helper function,
`branch_get_push_remoteref` that follows the logic of
`branch_get_push_1`, and call it from `remote_ref_for_branch`.
We also update t/6300-for-each-ref.sh to handle all `push.default`
strategies. This involves testing `push.default=simple` twice, once
where there is a matching upstream branch and once when there is none.
Signed-off-by: Damien Robert <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
0 commit comments