summaryrefslogtreecommitdiff
path: root/t/t5505-remote.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-05 19:40:41 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-05 19:40:41 -0800
commitba743d1b0ce0b44c797c0de06c9db2781e4d1fdd (patch)
treea1fb2a7e5be4820b4f4386c41b77c1c8f22e06b9 /t/t5505-remote.sh
parent7b75b331f6744fbf953fe8913703378ef86a2189 (diff)
parent441adf0ccf571a9fe15658fdfcd856d2aabc01cb (diff)
downloadgit-ba743d1b0ce0b44c797c0de06c9db2781e4d1fdd.tar.gz
Merge branch 'js/maint-remote-remove-mirror'
* js/maint-remote-remove-mirror: builtin-remote: make rm operation safer in mirrored repository builtin-remote: make rm() use properly named variable to hold return value
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 1f59960d90..bc5b7ce4a6 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -107,6 +107,32 @@ test_expect_success 'remove remote' '
)
'
+test_expect_success 'remove remote protects non-remote branches' '
+(
+ cd test &&
+ (cat >expect1 <<EOF
+Note: A non-remote branch was not removed; to delete it, use:
+ git branch -d master
+EOF
+ cat >expect2 <<EOF
+Note: Non-remote branches were not removed; to delete them, use:
+ git branch -d foobranch
+ git branch -d master
+EOF
+) &&
+ git tag footag
+ git config --add remote.oops.fetch "+refs/*:refs/*" &&
+ git remote rm oops 2>actual1 &&
+ git branch foobranch &&
+ git config --add remote.oops.fetch "+refs/*:refs/*" &&
+ git remote rm oops 2>actual2 &&
+ git branch -d foobranch &&
+ git tag -d footag &&
+ test_cmp expect1 actual1 &&
+ test_cmp expect2 actual2
+)
+'
+
cat > test/expect << EOF
* remote origin
URL: $(pwd)/one