rev_list_len = len(rev_list)
if rev_list_len == 1:
rev = rev_list[0]
- if rev[-1] == '/':
+ if rev.endswith('/'):
# the whole patch
- rev = rev[:-1]
- if rev[-1] == '/':
- rev = rev[:-1]
+ rev = strip_suffix('/', rev)
+ if rev.endswith('/'):
+ rev = strip_suffix('/', rev)
rev1 = rev + '//bottom'
rev2 = rev + '//top'
else:
if options.stat:
print git.diffstat(args, git_id(rev1), git_id(rev2))
else:
- pager(git.diff(args, git_id(rev1), git_id(rev2)))
+ diff_str = git.diff(args, git_id(rev1), git_id(rev2))
+ if diff_str:
+ pager(diff_str)