ignore: use git commondir for sourcing .git/info/exclude

Git looks for this file in GIT_COMMON_DIR, which is usually the same
as GIT_DIR (.git). However, when searching inside a linked worktree,
.git is usually a file that contains the path of the actual git dir,
which in turn contains a file "commondir" which references the directory
where info/exclude may reside, alongside other configuration shared across
all worktrees. This directory is usually the git dir of the main worktree.

Unlike git this does *not* read environment variables GIT_DIR and
GIT_COMMON_DIR, because it is not clear how to interpret them when
searching multiple repositories.

Fixes #1445, Closes #1446
This commit is contained in:
Johannes Altmanninger
2019-12-11 17:41:04 +01:00
committed by Andrew Gallant
parent 0c3b673e4c
commit 6f2b79f584
3 changed files with 178 additions and 20 deletions

View File

@@ -34,6 +34,8 @@ Bug fixes:
Fixes a performance bug when searching plain text files with very long lines.
* [BUG #1344](https://github.com/BurntSushi/ripgrep/issues/1344):
Document usage of `--type all`.
* [BUG #1445](https://github.com/BurntSushi/ripgrep/issues/1445):
ripgrep now respects ignore rules from .git/info/exclude in worktrees.
11.0.2 (2019-08-01)