| test_description='magic pathspec tests using git-add' |
| TEST_PASSES_SANITIZE_LEAK=true |
| test_expect_success 'setup' ' |
| test_expect_success 'add :/' " |
| (cd sub && git add -n :/ >actual) && |
| test_cmp expected sub/actual |
| test_expect_success 'add :/anothersub' ' |
| (cd sub && git add -n :/anothersub >actual) && |
| test_cmp expected sub/actual |
| test_expect_success 'add :/non-existent' ' |
| (cd sub && test_must_fail git add -n :/non-existent) |
| if test_have_prereq !MINGW && mkdir ":" 2>/dev/null |
| test_set_prereq COLON_DIR |
| test_expect_success COLON_DIR 'a file with the same (long) magic name exists' ' |
| test_must_fail git add -n ":(icase)ha" && |
| git add -n "./:(icase)ha" |
| test_expect_success COLON_DIR 'a file with the same (short) magic name exists' ' |
| test_must_fail git add -n :/bar && |