Browse Source

Handle binary files in diffstat

Added/removed counts are "-".

Change-Id: I339a91019f700106bae92b200aa554876065ea62
changes/91/391991/1
James E. Blair 8 years ago
parent
commit
989bccaa22
  1. 12
      gertty/view/change.py

12
gertty/view/change.py

@ -173,8 +173,16 @@ class RevisionRow(urwid.WidgetWrap):
total_added = 0
total_removed = 0
for added, removed, filename in stats:
total_added += int(added)
total_removed += int(removed)
try:
added = int(added)
except ValueError:
added = 0
try:
removed = int(removed)
except ValueError:
removed = 0
total_added += added
total_removed += removed
rows.append(urwid.Columns([urwid.Text(filename),
(10, urwid.Text('+%s, -%s' % (added, removed))),
]))

Loading…
Cancel
Save