aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/patch.go
diff options
context:
space:
mode:
authorFilip Navara <filip.navara@gmail.com>2019-04-26 10:07:59 +0200
committerFilip Navara <filip.navara@gmail.com>2019-04-26 10:07:59 +0200
commit14c17dc6881fccf851c8bdffab15774faa3bce8b (patch)
treee4e567231fee000bf6a6424577c60ce907431a18 /plumbing/object/patch.go
parent34cb7a3aededd002881504dd729527628e923fc6 (diff)
parentca5d7bb1a790303d2ca245cb6225850bcf5d12a6 (diff)
downloadgo-git-14c17dc6881fccf851c8bdffab15774faa3bce8b.tar.gz
Merge branch 'master' into commitgraph-obj
Diffstat (limited to 'plumbing/object/patch.go')
-rw-r--r--plumbing/object/patch.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/plumbing/object/patch.go b/plumbing/object/patch.go
index 068589e..1efd0b1 100644
--- a/plumbing/object/patch.go
+++ b/plumbing/object/patch.go
@@ -321,6 +321,10 @@ func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats {
for _, chunk := range fp.Chunks() {
s := chunk.Content()
+ if len(s) == 0 {
+ continue
+ }
+
switch chunk.Type() {
case fdiff.Add:
cs.Addition += strings.Count(s, "\n")