aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-12 21:45:56 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-12 21:45:56 -0700
commit2f5bfa7c7f271f2b7709c2822436178e2a216027 (patch)
tree62b4402c13d34a95bf5b3bf3d65083b361b9a8cd /t
parent592ebd087a1b33fe93dcd20a1466bc4d119d1c42 (diff)
parent441adf0ccf571a9fe15658fdfcd856d2aabc01cb (diff)
downloadgit-2f5bfa7c7f271f2b7709c2822436178e2a216027.tar.gz
git-2f5bfa7c7f271f2b7709c2822436178e2a216027.tar.xz
Merge branch 'js/maint-1.6.1-remote-remove-mirror' into maint-1.6.1
* js/maint-1.6.1-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')
-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 1f59960d9..bc5b7ce4a 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