From c0f94b849669c931388eadb9a2ab833ab1e11ce2 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Tue, 13 Aug 2024 16:21:46 +0800 Subject: [PATCH] diff_util: add copy records tracking to `DiffRenderer::show_patch` --- cli/src/diff_util.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/src/diff_util.rs b/cli/src/diff_util.rs index 1f14cb71aab..6c79beaffd0 100644 --- a/cli/src/diff_util.rs +++ b/cli/src/diff_util.rs @@ -344,13 +344,21 @@ impl<'a> DiffRenderer<'a> { ) -> Result<(), DiffRenderError> { let from_tree = commit.parent_tree(self.repo)?; let to_tree = commit.tree()?; + let mut copy_records = CopyRecords::default(); + for parent_id in commit.parent_ids() { + copy_records.add_records(self.repo.store().get_copy_records( + None, + parent_id, + commit.id(), + )?)?; + } self.show_diff( ui, formatter, &from_tree, &to_tree, matcher, - &Default::default(), + ©_records, width, ) }