From 990d1fe06e8c2db48a895aaa7e5e5eda8b330a5c Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Wed, 25 Jun 2008 00:41:41 +0200 Subject: fixed http://groups.google.com/group/git-python/browse_thread/thread/b8f3580abf31f9db?hl=en# and passed Git a working_tree again (sort of). --- lib/git/stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/git/stats.py') diff --git a/lib/git/stats.py b/lib/git/stats.py index 95dc875e..0fb6828c 100644 --- a/lib/git/stats.py +++ b/lib/git/stats.py @@ -9,8 +9,8 @@ class Stats(object): hsh = {'total': {'insertions': 0, 'deletions': 0, 'lines': 0, 'files': 0}, 'files': {}} for line in text.splitlines(): (insertions, deletions, filename) = line.split("\t") - hsh['total']['insertions'] += int(insertions) - hsh['total']['deletions'] += int(deletions) + hsh['total']['insertions'] += insertions != '-' and int(insertions) or 0 + hsh['total']['deletions'] += deleteions != '-' and int(deletions) or 0 hsh['total']['lines'] = (hsh['total']['deletions'] + hsh['total']['insertions']) hsh['total']['files'] += 1 hsh['files'][filename.strip()] = {'insertions': int(insertions), 'deletions': int(deletions)} -- cgit v1.2.1