summaryrefslogtreecommitdiff
path: root/t/t5505-remote.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-01-19 21:19:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-19 22:04:16 (GMT)
commitaf5bacf471825662f8eeda932cfabd6c47634434 (patch)
tree444c38da7ec6f93b958575f9e8c6aaa1f2dc44ff /t/t5505-remote.sh
parentc3808ca6982b0ad7ee9b87eca9b50b9a24ec08b0 (diff)
downloadgit-af5bacf471825662f8eeda932cfabd6c47634434.zip
git-af5bacf471825662f8eeda932cfabd6c47634434.tar.gz
git-af5bacf471825662f8eeda932cfabd6c47634434.tar.bz2
remote rename: demonstrate a bogus "remote exists" bug
Some users like to set `remote.origin.prune = true` in their ~/.gitconfig so that all of their repositories use that default. However, our code is ill-prepared for this, mistaking that single entry to mean that there is already a remote of the name "origin", even if there is not. This patch adds a test case demonstrating this issue. Reported by Andrew Arnott. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 8198d8e..2c03f44 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -764,6 +764,13 @@ test_expect_success 'rename a remote with name prefix of other remote' '
)
'
+test_expect_failure '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