3 test_description
='giving ignored paths to git add'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
9 mkdir sub dir dir/sub &&
10 echo sub >.gitignore &&
11 echo ign >>.gitignore &&
12 for p in . sub dir dir/sub
19 for i
in file dir
/file dir
'd*'
21 test_expect_success
"no complaints for unignored $i" '
24 git ls-files "$i" >out &&
29 for i
in ign dir
/ign dir
/sub dir
/sub
/*ign sub
/file sub sub
/*
31 test_expect_success
"complaints for ignored $i" '
33 test_must_fail git add "$i" 2>err &&
34 git ls-files "$i" >out &&
35 test_must_be_empty out
38 test_expect_success
"complaints for ignored $i output" '
39 test_i18ngrep -e "Use -f if" err
42 test_expect_success
"complaints for ignored $i with unignored file" '
44 test_must_fail git add "$i" file 2>err &&
45 git ls-files "$i" >out &&
46 test_must_be_empty out
48 test_expect_success
"complaints for ignored $i with unignored file output" '
49 test_i18ngrep -e "Use -f if" err
55 test_expect_success
"complaints for ignored $i in dir" '
59 test_must_fail git add "$i" 2>err &&
60 git ls-files "$i" >out &&
61 test_must_be_empty out
65 test_expect_success
"complaints for ignored $i in dir output" '
68 test_i18ngrep -e "Use -f if" err
75 test_expect_success
"complaints for ignored $i in sub" '
79 test_must_fail git add "$i" 2>err &&
80 git ls-files "$i" >out &&
81 test_must_be_empty out
85 test_expect_success
"complaints for ignored $i in sub output" '
88 test_i18ngrep -e "Use -f if" err