aboutsummaryrefslogtreecommitdiffstats
path: root/t/t2407-worktree-heads.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t2407-worktree-heads.sh')
-rwxr-xr-xt/t2407-worktree-heads.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh
index 97f5c87f8c..8a03f14df8 100755
--- a/t/t2407-worktree-heads.sh
+++ b/t/t2407-worktree-heads.sh
@@ -164,4 +164,26 @@ test_expect_success 'refuse to overwrite when in error states' '
done
'
+. "$TEST_DIRECTORY"/lib-rebase.sh
+
+test_expect_success !SANITIZE_LEAK 'refuse to overwrite during rebase with --update-refs' '
+ git commit --fixup HEAD~2 --allow-empty &&
+ (
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i --update-refs HEAD~3 >todo &&
+ ! grep "update-refs" todo
+ ) &&
+ git branch -f allow-update HEAD~2 &&
+ (
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i --update-refs HEAD~3 >todo &&
+ grep "update-ref refs/heads/allow-update" todo
+ )
+'
+
+# This must be the last test in this file
+test_expect_success '$EDITOR and friends are unchanged' '
+ test_editor_unchanged
+'
+
test_done