diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh index ca8568067d31d6..003329c082fae8 100755 --- a/t/t0050-filesystem.sh +++ b/t/t0050-filesystem.sh @@ -117,24 +117,4 @@ $test_unicode 'merge (silent unicode normalization)' ' git merge topic ' -test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case insensitive fs' ' - git init repo && - ( - cd repo && - - >Gitweb && - git add Gitweb && - git commit -m "add Gitweb" && - - git checkout --orphan todo && - git reset --hard && - mkdir -p gitweb/subdir && - >gitweb/subdir/file && - git add gitweb && - git commit -m "add gitweb/subdir/file" && - - git checkout main - ) -' - test_done diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh index 38c41ae37321ce..729a9bece17208 100755 --- a/t/t2021-checkout-overwrite.sh +++ b/t/t2021-checkout-overwrite.sh @@ -79,4 +79,27 @@ test_expect_success 'checkout --overwrite-ignore should succeed if only ignored test_path_is_file some_dir ' +test_expect_success 'checkout switching to a tracked file replaces a tracked directory' ' + git init -b main dir-to-file && + ( + cd dir-to-file && + + >Gitweb && + git add Gitweb && + git commit -m "add Gitweb" && + + git checkout --orphan todo && + git reset --hard && + mkdir -p gitweb/subdir && + >gitweb/subdir/file && + git add gitweb && + git commit -m "add gitweb/subdir/file" && + + git checkout main && + + test_path_is_file Gitweb && + test_path_is_missing gitweb + ) +' + test_done