From bb4d40c4d3e67cb3bf8d809824a4ea34834af376 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 17 Feb 2026 21:16:51 -0600 Subject: [PATCH] Enhance git metadata handling in compute_git_metadata function - Updated the `compute_git_metadata` function to include canonical path resolution for changed files, improving the accuracy of ID retrieval from the tree. - Implemented logic to check both the original and canonical paths for file IDs, ensuring comprehensive coverage of file changes. These changes enhance the robustness of git metadata handling, ensuring more reliable synchronization behavior. --- src/git.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/git.rs b/src/git.rs index dbc0fdfe..efe4834b 100644 --- a/src/git.rs +++ b/src/git.rs @@ -187,7 +187,16 @@ pub fn compute_git_metadata(tree_handle: &Arc>, repo_root: &Path for rel_path in &changed_files { let abs_path = repo_root.join(rel_path); - let ids = tree.get_ids_at_path(&abs_path); + let canonical_path = std::fs::canonicalize(&abs_path).ok(); + + let first = tree.get_ids_at_path(&abs_path); + let ids = if !first.is_empty() { + first + } else if let Some(ref canon) = canonical_path { + tree.get_ids_at_path(canon) + } else { + first + }; for &id in ids { if let Some(instance) = tree.get_instance(id) {