Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
of characters (disabled by default).
- Add support for `--literal` from [PanGan21](https://github.com/PanGan21)

### Fixed
- Respect glob patterns for `.` and `..` entries from `--all` [Jakub Kuczys](https://github.com/Jackenmen)

## [v1.0.0] - 2023-08-25

### Added
Expand Down
31 changes: 19 additions & 12 deletions src/meta/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,28 @@ impl Meta {
if matches!(flags.display, Display::All | Display::SystemProtected)
&& flags.layout != Layout::Tree
{
let mut current_meta = self.clone();
current_meta.name.name = ".".to_owned();
if !flags.ignore_globs.0.is_match(".") {
let mut current_meta = self.clone();
current_meta.name.name = ".".to_owned();

let mut parent_meta = Self::from_path(
&self.path.join(Component::ParentDir),
flags.dereference.0,
flags.permission == PermissionFlag::Disable,
)?;
parent_meta.name.name = "..".to_owned();
current_meta.git_status =
cache.and_then(|cache| cache.get(&current_meta.path, true));

content.push(current_meta);
}

if !flags.ignore_globs.0.is_match("..") {
let mut parent_meta = Self::from_path(
&self.path.join(Component::ParentDir),
flags.dereference.0,
flags.permission == PermissionFlag::Disable,
)?;
parent_meta.name.name = "..".to_owned();

current_meta.git_status = cache.and_then(|cache| cache.get(&current_meta.path, true));
parent_meta.git_status = cache.and_then(|cache| cache.get(&parent_meta.path, true));
parent_meta.git_status = cache.and_then(|cache| cache.get(&parent_meta.path, true));

content.push(current_meta);
content.push(parent_meta);
content.push(parent_meta);
}
}

let mut exit_code = ExitCode::OK;
Expand Down