aboutsummaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorSteffen Prohaska <prohaska@zib.de>2007-11-11 15:35:07 +0100
committerJunio C Hamano <gitster@pobox.com>2007-11-18 18:39:00 -0800
commit47d996a20c3347bb9efbb44e8ed2d615cfdffba3 (patch)
treed47b15f39935ad44d5c185f9ad25492a2c0fb8ed /t/t5516-fetch-push.sh
parentea55960518bb104020c02aa2f64b33f93d1775e7 (diff)
downloadgit-47d996a20c3347bb9efbb44e8ed2d615cfdffba3.tar.gz
git-47d996a20c3347bb9efbb44e8ed2d615cfdffba3.tar.xz
push: support pushing HEAD to real branch name
This teaches "push <remote> HEAD" to resolve HEAD on the local side to its real branch name, e.g. master, and then act as if the real branch name was specified. So we have a shorthand for pushing the current branch. Besides HEAD, no other symbolic ref is resolved. Thanks to Daniel Barkalow <barkalow@iabervon.org> for suggesting this implementation, which is much simpler than the implementation proposed before. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 86f9b5346..b0ff48816 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -244,6 +244,23 @@ test_expect_success 'push with colon-less refspec (4)' '
'
+test_expect_success 'push with HEAD' '
+
+ mk_test heads/master &&
+ git checkout master &&
+ git push testrepo HEAD &&
+ check_push_result $the_commit heads/master
+
+'
+
+test_expect_success 'push with HEAD nonexisting at remote' '
+
+ mk_test heads/master &&
+ git checkout -b local master &&
+ git push testrepo HEAD &&
+ check_push_result $the_commit heads/local
+'
+
test_expect_success 'push with dry-run' '
mk_test heads/master &&