ignore: support .git directory OR file

This improves support for submodules, which seem to use a '.git' file
instead of a '.git' directory to indicate a worktree.

Fixes #893
This commit is contained in:
Andrew Gallant
2018-04-23 18:33:25 -04:00
parent 2a9d007261
commit 507801c1f2
2 changed files with 35 additions and 2 deletions

View File

@@ -254,7 +254,7 @@ impl Ignore {
git_global_matcher: self.0.git_global_matcher.clone(),
git_ignore_matcher: gi_matcher,
git_exclude_matcher: gi_exclude_matcher,
has_git: dir.join(".git").is_dir(),
has_git: dir.join(".git").exists(),
opts: self.0.opts,
};
(ig, errs.into_error_option())