aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/patch.go
diff options
context:
space:
mode:
authorAlexandr Krylovskiy <alexandr.krylovskiy@gmail.com>2017-12-04 21:47:31 +0100
committerAlexandr Krylovskiy <alexandr.krylovskiy@gmail.com>2017-12-04 21:47:31 +0100
commit16544846f85e23a2b817daf8c9fdfceeb835f4a2 (patch)
tree22495839dcdba5f59cac19597e4e3ff46fec8e78 /plumbing/object/patch.go
parent02723bf0e5b97fc7855467b2fad700a4f318ab3e (diff)
downloadgo-git-16544846f85e23a2b817daf8c9fdfceeb835f4a2.tar.gz
Ignore empty patches when calculating stats (fixes #654)
Diffstat (limited to 'plumbing/object/patch.go')
-rw-r--r--plumbing/object/patch.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plumbing/object/patch.go b/plumbing/object/patch.go
index a920631..aa96a96 100644
--- a/plumbing/object/patch.go
+++ b/plumbing/object/patch.go
@@ -271,6 +271,11 @@ func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats {
var fileStats FileStats
for _, fp := range filePatches {
+ // ignore empty patches (binary files, submodule refs updates)
+ if len(fp.Chunks()) == 0 {
+ continue
+ }
+
cs := FileStat{}
from, to := fp.Files()
if from == nil {