aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-04 17:07:10 -0800
committerJunio C Hamano <gitster@pobox.com>2007-12-04 17:07:10 -0800
commit9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068 (patch)
treed626f21e0b87a364d213d3fba26cc92d9fb5a3f6 /t
parentf64c81d4282b1dacf2cf095bfb0f7708b99b3ecf (diff)
parent605b4978a105e2f40a353513f616be7d20f91c15 (diff)
downloadgit-9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068.tar.gz
git-9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068.tar.xz
Merge branch 'sp/refspec-match'
* sp/refspec-match: refactor fetch's ref matching to use refname_match() push: use same rules as git-rev-parse to resolve refspecs add refname_match() push: support pushing HEAD to real branch name
Diffstat (limited to 't')
-rwxr-xr-xt/t5510-fetch.sh25
-rwxr-xr-xt/t5516-fetch-push.sh29
2 files changed, 53 insertions, 1 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 35889c0a1..46a9c4d95 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -95,6 +95,31 @@ test_expect_success 'fetch following tags' '
'
+test_expect_failure 'fetch must not resolve short tag name' '
+
+ cd "$D" &&
+
+ mkdir five &&
+ cd five &&
+ git init &&
+
+ git fetch .. anno:five
+
+'
+
+test_expect_failure 'fetch must not resolve short remote name' '
+
+ cd "$D" &&
+ git-update-ref refs/remotes/six/HEAD HEAD
+
+ mkdir six &&
+ cd six &&
+ git init &&
+
+ git fetch .. six:six
+
+'
+
test_expect_success 'create bundle 1' '
cd "$D" &&
echo >file updated again by origin &&
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 987c9d21c..9d2dc33cb 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -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 &&