Skip to content

Commit 2d4c998

Browse files
committed
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.
1 parent fecea41 commit 2d4c998

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plumbing/object/patch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats {
317317
// File is deleted.
318318
cs.Name = from.Path()
319319
} else if from.Path() != to.Path() {
320-
// File is renamed. Not supported.
321-
// cs.Name = fmt.Sprintf("%s => %s", from.Path(), to.Path())
320+
// File is renamed.
321+
cs.Name = fmt.Sprintf("%s => %s", from.Path(), to.Path())
322322
} else {
323323
cs.Name = from.Path()
324324
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy