author | Daniel Barkalow <barkalow@iabervon.org> | |
Wed, 20 Feb 2008 17:54:05 +0000 (12:54 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 20 Feb 2008 19:06:27 +0000 (11:06 -0800) | ||
commit | 9f0ea7e8283da126c8e1d5e0c3b39c39200258ad | |
tree | 37bb16b202bee3a60f65481455fbe0f661335075 | tree | snapshot |
parent | e3c58f8b300dbc80b97a31a3a2758de00c5b52ce | commit | diff |
Resolve value supplied for no-colon push refspecs
When pushing a refspec like "HEAD", we used to treat it as
"HEAD:HEAD", which didn't work without rewriting. Instead, we should
resolve the ref. If it's a symref, further require it to point to a
branch, to avoid doing anything especially unexpected. Also remove the
rewriting previously added in builtin-push.
Since the code for "HEAD" uses the regular refspec parsing, it
automatically handles "+HEAD" without anything special.
[jc: added a further test to make sure that "remote.*.push = HEAD" works]
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When pushing a refspec like "HEAD", we used to treat it as
"HEAD:HEAD", which didn't work without rewriting. Instead, we should
resolve the ref. If it's a symref, further require it to point to a
branch, to avoid doing anything especially unexpected. Also remove the
rewriting previously added in builtin-push.
Since the code for "HEAD" uses the regular refspec parsing, it
automatically handles "+HEAD" without anything special.
[jc: added a further test to make sure that "remote.*.push = HEAD" works]
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-push.c | diff | blob | history | |
remote.c | diff | blob | history | |
t/t5516-fetch-push.sh | diff | blob | history |