Given the following reproduction:
mkdir /tmp/ignoretest
cd /tmp/ignoretest
mkdir foo
touch foo/bar.js
echo > .gitignore <<'EOT'
/*/
!/foo/
EOT
git init
git add .
git status
The foo/bar.js file got added to the repository. Doing the same on ignore, however:
const ignore = require(`ignore`);
ignore().add([
`/*/`,
`!/foo/`,
]).ignores(`foo/bar.js`) // true
Given the following reproduction:
The
foo/bar.jsfile got added to the repository. Doing the same onignore, however: