Skip to content

Commit

Permalink
ignore: squash noisy error message
Browse files Browse the repository at this point in the history
We should not assume that the commondir file actually exists. If it
doesn't, then just move on. This otherwise emits an error message when
searching normal submodules, which is not OK.

This regression was introduced in #1446.

Fixes #1520
  • Loading branch information
BurntSushi committed Mar 16, 2020
1 parent 5b30c2a commit 34edb81
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
12.0.1 (TBD)
============
ripgrep 12.0.1 is a small patch release that includes a couple minor bug fixes.
These bug fixes address regressions introduced in the 12.0.0 release.

Bug fixes:

* [BUG #1520](https://github.com/BurntSushi/ripgrep/issues/1520):
Don't emit spurious error messages in git repositories with submodules.


12.0.0 (2020-03-15)
===================
ripgrep 12 is a new major version release of ripgrep that contains many bug
Expand Down
6 changes: 2 additions & 4 deletions crates/ignore/src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,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: has_git,
has_git,
opts: self.0.opts,
};
(ig, errs.into_error_option())
Expand Down Expand Up @@ -817,9 +817,7 @@ fn resolve_git_commondir(
let git_commondir_file = || real_git_dir.join("commondir");
let file = match File::open(git_commondir_file()) {
Ok(file) => io::BufReader::new(file),
Err(err) => {
return Err(Some(Error::Io(err).with_path(git_commondir_file())));
}
Err(_) => return Err(None),
};
let commondir_line = match file.lines().next() {
Some(Ok(line)) => line,
Expand Down

0 comments on commit 34edb81

Please sign in to comment.