From aebf868d2a557384539cf91476d21901ab378643 Mon Sep 17 00:00:00 2001 From: Daniel Moch Date: Fri, 24 Nov 2023 12:29:45 -0500 Subject: plumbing: object, enable renames in getFileStatsFromFilePatches Diff has handled renames by default since 2020. This change sets Name for the renamed file in a manner similar to diffstat. --- plumbing/object/patch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plumbing/object/patch.go') diff --git a/plumbing/object/patch.go b/plumbing/object/patch.go index 06bc35b..dd8fef4 100644 --- a/plumbing/object/patch.go +++ b/plumbing/object/patch.go @@ -317,8 +317,8 @@ func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats { // File is deleted. cs.Name = from.Path() } else if from.Path() != to.Path() { - // File is renamed. Not supported. - // cs.Name = fmt.Sprintf("%s => %s", from.Path(), to.Path()) + // File is renamed. + cs.Name = fmt.Sprintf("%s => %s", from.Path(), to.Path()) } else { cs.Name = from.Path() } -- cgit