Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-24 03:06:07 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-24 03:06:07 +0400
commit182fb4df9120257c2e6b041dd58eef3de5b530d2 (patch)
treed24989f220fef3b241a367f22ee0aad7fabe4c0b /t
parente5e9714a106ab668ac982cf73f31919eb4e354fd (diff)
parenta83619d692deeb2565335144078465acb2dd1457 (diff)
Merge branch 'pb/push'
* pb/push: add special "matching refs" refspec
Diffstat (limited to 't')
-rwxr-xr-xt/t5511-refspec.sh5
-rwxr-xr-xt/t5516-fetch-push.sh41
2 files changed, 45 insertions, 1 deletions
diff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh
index 670a8f1c99..22ba380034 100755
--- a/t/t5511-refspec.sh
+++ b/t/t5511-refspec.sh
@@ -23,10 +23,13 @@ test_refspec () {
}
test_refspec push '' invalid
-test_refspec push ':' invalid
+test_refspec push ':'
+test_refspec push '::' invalid
+test_refspec push '+:'
test_refspec fetch ''
test_refspec fetch ':'
+test_refspec fetch '::' invalid
test_refspec push 'refs/heads/*:refs/remotes/frotz/*'
test_refspec push 'refs/heads/*:refs/remotes/frotz' invalid
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 3af03d4827..c5c59335f3 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -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 &&