Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
copy-tracking: minor rearrangement of match arms for didactic reasons
This could be squashed into parent, but the parent commit's diff seems
easier to review without this change.
  • Loading branch information
ilyagr committed Mar 18, 2026
commit 3c078a05b1f855a6fd0ecceb98e76958e8dd9e90
18 changes: 9 additions & 9 deletions lib/src/copies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,15 @@ async fn resolve_diff_entry_copies(
Some(TreeValue::File { copy_id: id2, .. }),
) if id1 == id2 => vec![CopyHistoryTreeDiffEntry::normal(diff_entry)],

// New file with copy history — needs copy-tracing.
(None, Some(f @ TreeValue::File { .. })) => {
let f = f.clone();
vec![CopyHistoryTreeDiffEntry {
target_path: diff_entry.path,
diffs: diffs_from_copies(before_tree, after_tree, f).await,
}]
}

// For files with non-matching copy-ids, or for a non-file that changes to a
// file, mark the first as deleted and do copy-tracing on the second.
//
Expand Down Expand Up @@ -456,15 +465,6 @@ async fn resolve_diff_entry_copies(
]
}

// New file with copy history — needs copy-tracing.
(None, Some(f @ TreeValue::File { .. })) => {
let f = f.clone();
vec![CopyHistoryTreeDiffEntry {
target_path: diff_entry.path,
diffs: diffs_from_copies(before_tree, after_tree, f).await,
}]
}

// Anything else (e.g. file => non-file non-tree), issue a simple diff entry.
//
// NOTE[deletion-diff-entry2]: this is another point where a spurious deletion entry
Expand Down