mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
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.
This commit is contained in:
parent
6dec06865f
commit
bb4d40c4d3
1 changed files with 10 additions and 1 deletions
11
src/git.rs
11
src/git.rs
|
|
@ -187,7 +187,16 @@ pub fn compute_git_metadata(tree_handle: &Arc<Mutex<RojoTree>>, 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue