>$dir/a.$i
done
done
+>"#ignore1"
+>"#ignore2"
+>"#hidden"
cat >expect <<EOF
a.2
EOF
echo '.gitignore
+\#ignore1
+\#ignore2*
+\#hid*n
output
expect
.gitignore
>output &&
test_cmp expect output'
-cat > excludes-file << EOF
+cat > excludes-file <<\EOF
*.[1-8]
e*
+\#*
EOF
git config core.excludesFile excludes-file
'
+test_expect_success 'negated exclude matches can override previous ones' '
+
+ git ls-files --others --exclude="a.*" --exclude="!a.1" >output &&
+ grep "^a.1" output
+'
+
test_done