diff options
author | Florian Apolloner <florian@apolloner.eu> | 2008-06-25 00:41:41 +0200 |
---|---|---|
committer | Florian Apolloner <florian@apolloner.eu> | 2008-06-25 00:43:07 +0200 |
commit | 990d1fe06e8c2db48a895aaa7e5e5eda8b330a5c (patch) | |
tree | a529af9a05481053a9286a346be7612fdee15df6 /lib/git/stats.py | |
parent | 7fda0ec787de5159534ebc8b81824920d9613575 (diff) | |
download | gitpython-990d1fe06e8c2db48a895aaa7e5e5eda8b330a5c.tar.gz |
fixed http://groups.google.com/group/git-python/browse_thread/thread/b8f3580abf31f9db?hl=en# and passed Git a working_tree again (sort of).
Diffstat (limited to 'lib/git/stats.py')
-rw-r--r-- | lib/git/stats.py | 4 |
1 files changed, 2 insertions, 2 deletions
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)} |