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>
Ramkumar Ramachandra committed
Jun 22, 2013 at 13:28 UTC
f0f249d18617848f98aee0b9b9bb90cfb2ecdb68
1 file changed
+14
-2
t/t5505-remote.sh
+14
-2
@@ -735,7 +735,9 @@ test_expect_success 'rename a remote with name prefix of other remote' '
735
cat >remotes_origin <<EOF
736
URL: $(pwd)/one
737
Push: refs/heads/master:refs/heads/upstream
738
+Push: refs/heads/next:refs/heads/upstream2
739
Pull: refs/heads/master:refs/heads/origin
740
+Pull: refs/heads/next:refs/heads/origin2
741
EOF
742
743
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' '
751
git remote rename origin origin &&
752
test_path_is_missing .git/remotes/origin &&
753
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
766
)
767
'
768