summaryrefslogtreecommitdiff
path: root/t/t2021-checkout-overwrite.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t2021-checkout-overwrite.sh')
-rwxr-xr-xt/t2021-checkout-overwrite.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh
index c2ada7de37..70d69263e6 100755
--- a/t/t2021-checkout-overwrite.sh
+++ b/t/t2021-checkout-overwrite.sh
@@ -51,4 +51,16 @@ test_expect_success SYMLINKS 'the symlink remained' '
test -h a/b
'
+test_expect_success SYMLINKS 'checkout -f must not follow symlinks when removing entries' '
+ git checkout -f start &&
+ mkdir dir &&
+ >dir/f &&
+ git add dir/f &&
+ git commit -m "add dir/f" &&
+ mv dir untracked &&
+ ln -s untracked dir &&
+ git checkout -f HEAD~ &&
+ test_path_is_file untracked/f
+'
+
test_done