Merge branch 'js/travis-32bit-linux'
[gitweb.git] / t / t5505-remote.sh
index f558ad0b39362255ceec67ef219edc91230d0ec3..a6c0178f3af6c3e3f01816197e51e9bca546b00a 100755 (executable)
@@ -744,7 +744,7 @@ test_expect_success 'rename a remote' '
        (
                cd four &&
                git remote rename origin upstream &&
-               rmdir .git/refs/remotes/origin &&
+               test -z "$(git for-each-ref 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/*" &&
@@ -783,6 +783,13 @@ test_expect_success 'rename a remote with name prefix of other remote' '
        )
 '
 
+test_expect_success 'rename succeeds with existing remote.<target>.prune' '
+       git clone one four.four &&
+       test_when_finished git config --global --unset remote.upstream.prune &&
+       git config --global remote.upstream.prune true &&
+       git -C four.four remote rename origin upstream
+'
+
 cat >remotes_origin <<EOF
 URL: $(pwd)/one
 Push: refs/heads/master:refs/heads/upstream