Match ignore-glob(s) against name instead of path

This commit is contained in:
Sumit Sahrawat 2019-09-14 12:00:20 +05:30 committed by Pierre Peltier
parent 148c78d418
commit b5e13f25c7

View file

@ -95,16 +95,16 @@ impl Meta {
for entry in entries {
let path = entry?.path();
if ignore_globs.is_match(&path) {
let name = path
.file_name()
.ok_or_else(|| Error::new(ErrorKind::InvalidInput, "invalid file name"))?;
if ignore_globs.is_match(&name) {
continue;
}
if let Display::DisplayOnlyVisible = display {
if path
.file_name()
.ok_or_else(|| Error::new(ErrorKind::InvalidInput, "invalid file name"))?
.to_string_lossy()
.starts_with('.')
if name.to_string_lossy().starts_with('.')
{
continue;
}