We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80091b8 commit 6c0d0faCopy full SHA for 6c0d0fa
plumbing/object/patch.go
@@ -320,11 +320,18 @@ func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats {
320
}
321
322
for _, chunk := range fp.Chunks() {
323
+ s := chunk.Content()
324
switch chunk.Type() {
325
case fdiff.Add:
- cs.Addition += strings.Count(chunk.Content(), "\n")
326
+ cs.Addition += strings.Count(s, "\n")
327
+ if s[len(s)-1] != '\n' {
328
+ cs.Addition++
329
+ }
330
case fdiff.Delete:
- cs.Deletion += strings.Count(chunk.Content(), "\n")
331
+ cs.Deletion += strings.Count(s, "\n")
332
333
+ cs.Deletion++
334
335
336
337
0 commit comments