Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit f0f249d

Browse files
artagnongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f0779ae commit f0f249d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

t/t5505-remote.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,9 @@ test_expect_success 'rename a remote with name prefix of other remote' '
735735
cat >remotes_origin <<EOF
736736
URL: $(pwd)/one
737737
Push: refs/heads/master:refs/heads/upstream
738+
Push: refs/heads/next:refs/heads/upstream2
738739
Pull: refs/heads/master:refs/heads/origin
740+
Pull: refs/heads/next:refs/heads/origin2
739741
EOF
740742

741743
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' '
749751
git remote rename origin origin &&
750752
test_path_is_missing .git/remotes/origin &&
751753
test "$(git config remote.origin.url)" = "$origin_url" &&
752-
test "$(git config remote.origin.push)" = "refs/heads/master:refs/heads/upstream" &&
753-
test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin"
754+
cat >push_expected <<-\EOF &&
755+
refs/heads/master:refs/heads/upstream
756+
refs/heads/next:refs/heads/upstream2
757+
EOF
758+
cat >fetch_expected <<-\EOF &&
759+
refs/heads/master:refs/heads/origin
760+
refs/heads/next:refs/heads/origin2
761+
EOF
762+
git config --get-all remote.origin.push >push_actual &&
763+
git config --get-all remote.origin.fetch >fetch_actual &&
764+
test_cmp push_expected push_actual &&
765+
test_cmp fetch_expected fetch_actual
754766
)
755767
'
756768

0 commit comments

Comments
 (0)