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 &&
35 grep -e "Use -f if" err &&
39 test_expect_success "complaints for ignored $i with unignored file" '
41 test_must_fail git add "$i" file 2>err &&
42 git ls-files "$i" >out &&
44 grep -e "Use -f if" err &&
51 test_expect_success "complaints for ignored $i in dir" '
55 test_must_fail git add "$i" 2>err &&
56 git ls-files "$i" >out &&
58 grep -e "Use -f if" err &&
66 test_expect_success "complaints for ignored $i in sub" '
70 test_must_fail git add "$i" 2>err &&
71 git ls-files "$i" >out &&
73 grep -e "Use -f if" err &&