Skip to content

Commit 4504336

Browse files
committedSep 13, 2024·
Add symlinks to the database
1 parent c1d7c4f commit 4504336

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636
- fish: `cd` command is now copied directly from
3737
`$__fish_data_dir/functions/cd.fish`. This should minimize the chances of an
3838
infinite loop when aliasing `cd=z`.
39+
- Symlinks not getting added to the database when `$_ZO_RESOLVE_SYMLINKS=0`.
3940

4041
## [0.9.4] - 2024-02-21
4142

‎src/db/stream.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ impl<'a> Stream<'a> {
8383
if !self.options.exists {
8484
return true;
8585
}
86+
87+
// The logic here is reversed - if we resolve symlinks when adding entries to
88+
// the database, we should not return symlinks when querying back from
89+
// the database.
8690
let resolver =
87-
if self.options.resolve_symlinks { fs::metadata } else { fs::symlink_metadata };
91+
if self.options.resolve_symlinks { fs::symlink_metadata } else { fs::metadata };
8892
resolver(path).map(|metadata| metadata.is_dir()).unwrap_or_default()
8993
}
9094
}

0 commit comments

Comments
 (0)
Please sign in to comment.