summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-26 23:12:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-26 23:12:19 (GMT)
commit716b64a73e65d7494dfb37631292fcbe8cb34cc0 (patch)
treec697475e252e513b72e37243365d2bc9ea0cd5e7 /t
parent8371e91463d8d9507244952f1652f2c1e0779a84 (diff)
parentb52d00aedeb94f12a16afcef1bb33c989f9b4105 (diff)
downloadgit-716b64a73e65d7494dfb37631292fcbe8cb34cc0.zip
git-716b64a73e65d7494dfb37631292fcbe8cb34cc0.tar.gz
git-716b64a73e65d7494dfb37631292fcbe8cb34cc0.tar.bz2
Merge branch 'mz/remote-rename' into maint-1.7.6
* mz/remote-rename: remote: only update remote-tracking branch if updating refspec remote rename: warn when refspec was not updated remote: "rename o foo" should not rename ref "origin/bar" remote: write correct fetch spec when renaming remote 'remote'
Diffstat (limited to 't')
-rwxr-xr-xt/t5505-remote.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 0d0222e..e8af615 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -631,6 +631,37 @@ test_expect_success 'rename a remote' '
'
+test_expect_success 'rename does not update a non-default fetch refspec' '
+
+ git clone one four.one &&
+ (cd four.one &&
+ git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* &&
+ git remote rename origin upstream &&
+ test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" &&
+ git rev-parse -q origin/master)
+
+'
+
+test_expect_success 'rename a remote with name part of fetch spec' '
+
+ git clone one four.two &&
+ (cd four.two &&
+ git remote rename origin remote &&
+ git remote rename remote upstream &&
+ test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*")
+
+'
+
+test_expect_success 'rename a remote with name prefix of other remote' '
+
+ git clone one four.three &&
+ (cd four.three &&
+ git remote add o git://example.com/repo.git &&
+ git remote rename o upstream &&
+ test "$(git rev-parse origin/master)" = "$(git rev-parse master)")
+
+'
+
cat > remotes_origin << EOF
URL: $(pwd)/one
Push: refs/heads/master:refs/heads/upstream