Code

Merge branch 'db/clone-in-c'
[git.git] / t / t5516-fetch-push.sh
index 3af03d482727b69e4724d50eaf9ccc5fc8dceeee..c5c59335f36d0d8f6a26ee606fd605e74e2d1e33 100755 (executable)
@@ -165,6 +165,47 @@ test_expect_success 'push with matching heads' '
 
 '
 
+test_expect_success 'push with matching heads on the command line' '
+
+       mk_test heads/master &&
+       git push testrepo : &&
+       check_push_result $the_commit heads/master
+
+'
+
+test_expect_success 'failed (non-fast-forward) push with matching heads' '
+
+       mk_test heads/master &&
+       git push testrepo : &&
+       git commit --amend -massaged &&
+       ! git push testrepo &&
+       check_push_result $the_commit heads/master &&
+       git reset --hard $the_commit
+
+'
+
+test_expect_success 'push --force with matching heads' '
+
+       mk_test heads/master &&
+       git push testrepo : &&
+       git commit --amend -massaged &&
+       git push --force testrepo &&
+       ! check_push_result $the_commit heads/master &&
+       git reset --hard $the_commit
+
+'
+
+test_expect_success 'push with matching heads and forced update' '
+
+       mk_test heads/master &&
+       git push testrepo : &&
+       git commit --amend -massaged &&
+       git push testrepo +: &&
+       ! check_push_result $the_commit heads/master &&
+       git reset --hard $the_commit
+
+'
+
 test_expect_success 'push with no ambiguity (1)' '
 
        mk_test heads/master &&