diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-03-31 00:35:36 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-31 00:35:36 +0300 |
commit | 9210c68d2af84d869f1635efe9a2092578653297 (patch) | |
tree | 3967574291f29eca2c480266658e2d4185370d66 /t | |
parent | 84d06cdc06389ae7c462434cb7b1db0980f63860 (diff) | |
parent | fab78a0c3defddff87ea5aa7dd32c5e444c43f1f (diff) |
Merge branch 'mt/checkout-remove-nofollow'
When "git checkout" removes a path that does not exist in the
commit it is checking out, it wasn't careful enough not to follow
symbolic links, which has been corrected.
* mt/checkout-remove-nofollow:
checkout: don't follow symlinks when removing entries
symlinks: update comment on threaded_check_leading_path()
Diffstat (limited to 't')
-rwxr-xr-x | t/t2021-checkout-overwrite.sh | 12 |
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 |