Kaynağa Gözat

Properly handle empty commits with no changes.

Clear files, inserted and deleted after storing them for the preceding commit.

git-svn, for example, can have empty commits (when a directory is created),
causing the statistics to get skewed.

[hoxu@users.sf.net: rewrote commit message based on Tyler's mail]

Signed-off-by: Heikki Hokkanen <hoxu@users.sf.net>
Tyler Nielsen 15 yıl önce
ebeveyn
işleme
6f5314e993
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  1. 1
    0
      gitstats

+ 1
- 0
gitstats Dosyayı Görüntüle

@@ -409,6 +409,7 @@ class GitDataCollector(DataCollector):
409 409
 							self.authors[author] = { 'lines_added' : 0, 'lines_removed' : 0 }
410 410
 						self.authors[author]['lines_added'] = self.authors[author].get('lines_added', 0) + inserted
411 411
 						self.authors[author]['lines_removed'] = self.authors[author].get('lines_removed', 0) + deleted
412
+						files, inserted, deleted = 0, 0, 0
412 413
 					except ValueError:
413 414
 						print 'Warning: unexpected line "%s"' % line
414 415
 				else: