aboutsummaryrefslogtreecommitdiff
path: root/t/t5505-remote.sh
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-11-03 19:26:18 +0100
committerJunio C Hamano <gitster@pobox.com>2008-11-05 12:23:48 -0800
commitbf98421a3363696f3b4c8aedc242bfaadc1ce6f6 (patch)
treef3515cea21f61083867f59b0d7254de801acaf9a /t/t5505-remote.sh
parent6331adb9c4ec36c70dc3ecc6eb46b7dddb36952d (diff)
downloadgit-bf98421a3363696f3b4c8aedc242bfaadc1ce6f6.tar.gz
git-bf98421a3363696f3b4c8aedc242bfaadc1ce6f6.tar.xz
Implement git remote rename
The new rename subcommand does the followings: 1) Renames the remote.foo configuration section to remote.bar 2) Updates the remote.bar.fetch refspecs 3) Updates the branch.*.remote settings 4) Renames the tracking branches: renames the normal refs and rewrites the symrefs to point to the new refs. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index c4380c7e3..0c956bad6 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -328,4 +328,19 @@ test_expect_success 'reject adding remote with an invalid name' '
'
+# The first three test if the tracking branches are properly renamed,
+# the last two ones check if the config is updated.
+
+test_expect_success 'rename a remote' '
+
+ git clone one four &&
+ (cd four &&
+ git remote rename origin upstream &&
+ rmdir .git/refs/remotes/origin &&
+ test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
+ test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
+ test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
+ test "$(git config branch.master.remote)" = "upstream")
+
+'
test_done