summaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 11:54:28 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-27 11:54:28 -0800
commit2f8e2e3eeffd427a82467556941c31dc246a69c5 (patch)
tree27c751ef65f0c0baf38c52264038f774d38df56c /t/t5516-fetch-push.sh
parent5372715ed268b190b022a12579767816ea6738ae (diff)
parent9f0ea7e8283da126c8e1d5e0c3b39c39200258ad (diff)
downloadgit-2f8e2e3eeffd427a82467556941c31dc246a69c5.tar.gz
Merge branch 'db/push-single-with-HEAD'
* db/push-single-with-HEAD: Resolve value supplied for no-colon push refspecs
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 9023ba05af..793ffc6600 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -302,6 +302,49 @@ test_expect_success 'push with HEAD nonexisting at remote' '
check_push_result $the_commit heads/local
'
+test_expect_success 'push with +HEAD' '
+
+ mk_test heads/master &&
+ git checkout master &&
+ git branch -D local &&
+ git checkout -b local &&
+ git push testrepo master local &&
+ check_push_result $the_commit heads/master &&
+ check_push_result $the_commit heads/local &&
+
+ # Without force rewinding should fail
+ git reset --hard HEAD^ &&
+ ! git push testrepo HEAD &&
+ check_push_result $the_commit heads/local &&
+
+ # With force rewinding should succeed
+ git push testrepo +HEAD &&
+ check_push_result $the_first_commit heads/local
+
+'
+
+test_expect_success 'push with config remote.*.push = HEAD' '
+
+ mk_test heads/local &&
+ git checkout master &&
+ git branch -f local $the_commit &&
+ (
+ cd testrepo &&
+ git checkout local &&
+ git reset --hard $the_first_commit
+ ) &&
+ git config remote.there.url testrepo &&
+ git config remote.there.push HEAD &&
+ git config branch.master.remote there &&
+ git push &&
+ check_push_result $the_commit heads/master &&
+ check_push_result $the_first_commit heads/local
+'
+
+# clean up the cruft left with the previous one
+git config --remove-section remote.there
+git config --remove-section branch.master
+
test_expect_success 'push with dry-run' '
mk_test heads/master &&