Skip to content

Commit 15639e4

Browse files
committed
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.
1 parent 891ee89 commit 15639e4

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

lib/src/copies.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,15 @@ async fn classify_diff_entry(
411411
Some(TreeValue::File { copy_id: id2, .. }),
412412
) if id1 == id2 => vec![CopyHistoryTreeDiffEntry::normal(diff_entry)],
413413

414+
// New file with copy history — needs copy-tracing.
415+
(None, Some(f @ TreeValue::File { .. })) => {
416+
let f = f.clone();
417+
vec![CopyHistoryTreeDiffEntry {
418+
target_path: diff_entry.path,
419+
diffs: diffs_from_copies(before_tree, after_tree, f).await,
420+
}]
421+
}
422+
414423
// For files with non-matching copy-ids, or for a non-file that changes to a
415424
// file, mark the first as deleted and do copy-tracing on the second.
416425
//
@@ -445,15 +454,6 @@ async fn classify_diff_entry(
445454
]
446455
}
447456

448-
// New file with copy history — needs copy-tracing.
449-
(None, Some(f @ TreeValue::File { .. })) => {
450-
let f = f.clone();
451-
vec![CopyHistoryTreeDiffEntry {
452-
target_path: diff_entry.path,
453-
diffs: diffs_from_copies(before_tree, after_tree, f).await,
454-
}]
455-
}
456-
457457
// Anything else (e.g. file => non-file non-tree), issue a simple diff entry.
458458
//
459459
// NOTE[deletion-diff-entry2]: this is another point where a spurious deletion entry

0 commit comments

Comments
 (0)