3 test_description
='giving ignored paths to git add'
7 test_expect_success setup
'
8 mkdir sub dir dir/sub &&
9 echo sub >.gitignore &&
10 echo ign >>.gitignore &&
11 for p in . sub dir dir/sub
18 for i
in file dir
/file dir
'd*'
20 test_expect_success
"no complaints for unignored $i" '
23 git ls-files "$i" >out &&
28 for i
in ign dir
/ign dir
/sub dir
/sub
/*ign sub
/file sub sub
/*
30 test_expect_success
"complaints for ignored $i" '
32 test_must_fail git add "$i" 2>err &&
33 git ls-files "$i" >out &&
37 test_expect_success
"complaints for ignored $i output" '
38 test_i18ngrep -e "Use -f if" err
41 test_expect_success
"complaints for ignored $i with unignored file" '
43 test_must_fail git add "$i" file 2>err &&
44 git ls-files "$i" >out &&
47 test_expect_success
"complaints for ignored $i with unignored file output" '
48 test_i18ngrep -e "Use -f if" err
54 test_expect_success
"complaints for ignored $i in dir" '
58 test_must_fail git add "$i" 2>err &&
59 git ls-files "$i" >out &&
64 test_expect_success
"complaints for ignored $i in dir output" '
67 test_i18ngrep -e "Use -f if" err
74 test_expect_success
"complaints for ignored $i in sub" '
78 test_must_fail git add "$i" 2>err &&
79 git ls-files "$i" >out &&
84 test_expect_success
"complaints for ignored $i in sub output" '
87 test_i18ngrep -e "Use -f if" err