]> git.ipfire.org Git - thirdparty/git.git/commit - refspec.c
refspec: make @ a synonym of HEAD
authorFelipe Contreras <felipe.contreras@gmail.com>
Thu, 26 Nov 2020 00:16:16 +0000 (18:16 -0600)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Nov 2020 21:57:55 +0000 (13:57 -0800)
commit374fbaef3df8f05acf9968fc38c6da72a62bcfc2
tree13cca8b260b1ddeee0d3901a452a784cc13aa7be
parente7f80eafd1be8c6771ef3e1e389853e18ed7e90b
refspec: make @ a synonym of HEAD

Since commit 9ba89f484e git learned how to push to a remote branch using
the source @, for example:

  git push origin @:master

However, if the right-hand side is missing, the push fails:

  git push origin @

It is obvious what is the desired behavior, and allowing the push makes
things more consistent.

Additionally, @:master now has the same semantics as HEAD:master.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refspec.c
t/t5511-refspec.sh
t/t5516-fetch-push.sh