Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 1654484

Browse files
committed
Ignore empty patches when calculating stats (fixes #654)
1 parent 02723bf commit 1654484

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plumbing/object/patch.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats {
271271
var fileStats FileStats
272272

273273
for _, fp := range filePatches {
274+
// ignore empty patches (binary files, submodule refs updates)
275+
if len(fp.Chunks()) == 0 {
276+
continue
277+
}
278+
274279
cs := FileStat{}
275280
from, to := fp.Files()
276281
if from == nil {

0 commit comments

Comments
 (0)