Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Absolute path in .gitignore are interpreted from the current directory instead of the .gitignore file path #1318

Open
Congelli501 opened this issue Apr 14, 2019 · 0 comments

Comments

@Congelli501
Copy link

Lines starting with a "/" in .gitignore files should be interpreted as being relative the the .gitignore file path, but they are interpreted as beeing relative to cwd for ag.

How to reproduce:

cd /tmp
rm -fr test
mkdir test
cd test
mkdir -p subdir/dir1
echo 'aaa' > subdir/dir1/f

cat > .gitignore << 'EOF'
/dir1
EOF

# Not working -> dir1 should be ignored
ag aaa .
cd subdir

# Working as cwd is the location of the .gitignore file -> dir1 is ignored
ag aaa .
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant