mirror of
https://github.com/martinvonz/jj.git
synced 2024-11-25 00:36:30 +00:00
working_copy: don't follow symlinks when visiting files in gitignored directory
Fixes #2878
This commit is contained in:
parent
d0d4496258
commit
5a7d8ac596
3 changed files with 4 additions and 3 deletions
|
@ -37,6 +37,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Fixed bugs
|
||||
|
||||
* Fixed snapshots of symlinks in `gitignore`-d directory.
|
||||
[#2878](https://github.com/martinvonz/jj/issues/2878)
|
||||
|
||||
|
||||
## [0.13.0] - 2024-01-03
|
||||
|
||||
|
|
|
@ -894,7 +894,7 @@ impl TreeState {
|
|||
continue;
|
||||
}
|
||||
let disk_path = tracked_path.to_fs_path(&self.working_copy_path);
|
||||
let metadata = match disk_path.metadata() {
|
||||
let metadata = match disk_path.symlink_metadata() {
|
||||
Ok(metadata) => metadata,
|
||||
Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
|
||||
continue;
|
||||
|
|
|
@ -836,9 +836,7 @@ fn test_gitignores_ignored_directory_already_tracked() {
|
|||
(modified_normal_path, Kind::Normal, "modified"),
|
||||
(unchanged_executable_path, Kind::Executable, "contents"),
|
||||
(modified_executable_path, Kind::Executable, "modified"),
|
||||
#[cfg(not(unix))] // TODO
|
||||
(unchanged_symlink_path, Kind::Symlink, "contents"),
|
||||
#[cfg(not(unix))] // TODO
|
||||
(modified_symlink_path, Kind::Symlink, "modified"),
|
||||
]);
|
||||
assert_eq!(
|
||||
|
|
Loading…
Reference in a new issue