aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/patch.go
diff options
context:
space:
mode:
authorDaniel Moch <daniel@danielmoch.com>2023-11-24 12:29:45 -0500
committerDaniel Moch <daniel@danielmoch.com>2023-11-27 19:36:37 -0500
commitaebf868d2a557384539cf91476d21901ab378643 (patch)
treef4d0ef4af91cf439c9020408179dd7e22f05c9c1 /plumbing/object/patch.go
parentfecea417bfc18648757a1bde30ca384548b55197 (diff)
downloadgo-git-aebf868d2a557384539cf91476d21901ab378643.tar.gz
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.
Diffstat (limited to 'plumbing/object/patch.go')
-rw-r--r--plumbing/object/patch.go4
1 files changed, 2 insertions, 2 deletions
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()
}