aboutsummaryrefslogtreecommitdiff
path: root/t/t5505-remote.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-22 13:28:18 +0530
committerJunio C Hamano <gitster@pobox.com>2013-06-23 00:33:58 -0700
commitf0f249d18617848f98aee0b9b9bb90cfb2ecdb68 (patch)
tree569c5eae2f7323edf0affcdd4acf0de8f0fdc4ff /t/t5505-remote.sh
parentf0779aef8e9178a8abbadba2eed6b80d8d67e94d (diff)
downloadgit-f0f249d18617848f98aee0b9b9bb90cfb2ecdb68.tar.gz
git-f0f249d18617848f98aee0b9b9bb90cfb2ecdb68.tar.xz
t/t5505-remote: test multiple push/pull in remotes-file
Extend the test "migrate a remote from named file in $GIT_DIR/remotes" to test that multiple "Push:" and "Pull:" lines in the remotes-file works as expected. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index b910f540e..ee5d65d52 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -735,7 +735,9 @@ test_expect_success 'rename a remote with name prefix of other remote' '
cat >remotes_origin <<EOF
URL: $(pwd)/one
Push: refs/heads/master:refs/heads/upstream
+Push: refs/heads/next:refs/heads/upstream2
Pull: refs/heads/master:refs/heads/origin
+Pull: refs/heads/next:refs/heads/origin2
EOF
test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
@@ -749,8 +751,18 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
git remote rename origin origin &&
test_path_is_missing .git/remotes/origin &&
test "$(git config remote.origin.url)" = "$origin_url" &&
- test "$(git config remote.origin.push)" = "refs/heads/master:refs/heads/upstream" &&
- test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin"
+ cat >push_expected <<-\EOF &&
+ refs/heads/master:refs/heads/upstream
+ refs/heads/next:refs/heads/upstream2
+ EOF
+ cat >fetch_expected <<-\EOF &&
+ refs/heads/master:refs/heads/origin
+ refs/heads/next:refs/heads/origin2
+ EOF
+ git config --get-all remote.origin.push >push_actual &&
+ git config --get-all remote.origin.fetch >fetch_actual &&
+ test_cmp push_expected push_actual &&
+ test_cmp fetch_expected fetch_actual
)
'