diff --git a/CHANGELOG.md b/CHANGELOG.md index 4106a4c9f..77e07fb7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/src/local_working_copy.rs b/lib/src/local_working_copy.rs index 5045dc318..3e351f4cf 100644 --- a/lib/src/local_working_copy.rs +++ b/lib/src/local_working_copy.rs @@ -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; diff --git a/lib/tests/test_local_working_copy.rs b/lib/tests/test_local_working_copy.rs index 6566ee3b7..fb8253cf6 100644 --- a/lib/tests/test_local_working_copy.rs +++ b/lib/tests/test_local_working_copy.rs @@ -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!(