mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-04-06 07:21:51 +00:00
Don’t ignore .gitignore errors
This commit is contained in:
parent
3d3ee8fd66
commit
1f23f3f0cc
@ -24,7 +24,6 @@ impl IgnoreCache {
|
|||||||
IgnoreCache::default()
|
IgnoreCache::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused_results)] // don’t do this
|
|
||||||
pub fn discover_underneath(&self, path: &Path) {
|
pub fn discover_underneath(&self, path: &Path) {
|
||||||
let mut path = Some(path);
|
let mut path = Some(path);
|
||||||
let mut entries = self.entries.write().unwrap();
|
let mut entries = self.entries.write().unwrap();
|
||||||
@ -37,11 +36,15 @@ impl IgnoreCache {
|
|||||||
debug!("Found a .gitignore file: {:?}", ignore_file);
|
debug!("Found a .gitignore file: {:?}", ignore_file);
|
||||||
if let Ok(mut file) = File::open(ignore_file) {
|
if let Ok(mut file) = File::open(ignore_file) {
|
||||||
let mut contents = String::new();
|
let mut contents = String::new();
|
||||||
file.read_to_string(&mut contents).expect("Reading gitignore failed");
|
|
||||||
|
|
||||||
|
match file.read_to_string(&mut contents) {
|
||||||
|
Ok(_) => {
|
||||||
let (patterns, mut _errors) = IgnorePatterns::parse_from_iter(contents.lines());
|
let (patterns, mut _errors) = IgnorePatterns::parse_from_iter(contents.lines());
|
||||||
entries.push((p.into(), patterns));
|
entries.push((p.into(), patterns));
|
||||||
}
|
}
|
||||||
|
Err(e) => debug!("Failed to read a .gitignore: {:?}", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug!("Found no .gitignore file at {:?}", ignore_file);
|
debug!("Found no .gitignore file at {:?}", ignore_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user