expose a helper function peel_to_type().
[gitweb.git] / t / t5516-fetch-push.sh
index 987c9d21caf2a3d7653157f5e6d74f0841863c8b..9d2dc33cbd0d1df19b0a9003e545104a982da694 100755 (executable)
@@ -145,11 +145,21 @@ test_expect_success 'push with no ambiguity (1)' '
 test_expect_success 'push with no ambiguity (2)' '
 
        mk_test remotes/origin/master &&
-       git push testrepo master:master &&
+       git push testrepo master:origin/master &&
        check_push_result $the_commit remotes/origin/master
 
 '
 
+test_expect_success 'push with colon-less refspec, no ambiguity' '
+
+       mk_test heads/master heads/t/master &&
+       git branch -f t/master master &&
+       git push testrepo master &&
+       check_push_result $the_commit heads/master &&
+       check_push_result $the_first_commit heads/t/master
+
+'
+
 test_expect_success 'push with weak ambiguity (1)' '
 
        mk_test heads/master remotes/origin/master &&
@@ -244,6 +254,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 &&