git-svn: support for git-svn propset
[gitweb.git] / t / t3200-branch.sh
index 83037b1cd94046ea1ec82819b7d30790b28634d2..432921b6b81684313c6b0041a288749c30fdee8e 100755 (executable)
@@ -285,6 +285,15 @@ test_expect_success 'deleting a dangling symref' '
        test_i18ncmp expect actual
 '
 
+test_expect_success 'deleting a self-referential symref' '
+       git symbolic-ref refs/heads/self-reference refs/heads/self-reference &&
+       test_path_is_file .git/refs/heads/self-reference &&
+       echo "Deleted branch self-reference (was refs/heads/self-reference)." >expect &&
+       git branch -d self-reference >actual &&
+       test_path_is_missing .git/refs/heads/self-reference &&
+       test_i18ncmp expect actual
+'
+
 test_expect_success 'renaming a symref is not allowed' '
        git symbolic-ref refs/heads/master2 refs/heads/master &&
        test_must_fail git branch -m master2 master3 &&
@@ -859,11 +868,7 @@ test_expect_success 'detect typo in branch name when using --edit-description' '
        write_script editor <<-\EOF &&
                echo "New contents" >"$1"
        EOF
-       (
-               EDITOR=./editor &&
-               export EDITOR &&
-               test_must_fail git branch --edit-description no-such-branch
-       )
+       test_must_fail env EDITOR=./editor git branch --edit-description no-such-branch
 '
 
 test_expect_success 'refuse --edit-description on unborn branch for now' '
@@ -871,11 +876,7 @@ test_expect_success 'refuse --edit-description on unborn branch for now' '
                echo "New contents" >"$1"
        EOF
        git checkout --orphan unborn &&
-       (
-               EDITOR=./editor &&
-               export EDITOR &&
-               test_must_fail git branch --edit-description
-       )
+       test_must_fail env EDITOR=./editor git branch --edit-description
 '
 
 test_expect_success '--merged catches invalid object names' '