diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index 0193f68..afb865d 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -267,25 +267,31 @@ def blame_loc(loc, repo, username, blame): '' ] - cnt = 1 for idx, line in enumerate(loc.split('\n')): if line == '': break + + try: + diff = blame.for_line(idx + 1) + except IndexError: + # Happens at the end of the file, since we are using idx + 1 + continue + + if line.startswith('')[1] + output.append( '' - % ({'cnt': cnt}) + % ({'cnt': idx}) ) - cnt += 1 - if line.startswith('')[1] - diff = blame.for_line(idx + 1) output.append( '' % author_to_user( diff.orig_committer, with_name=False) ) + output.append( '' % ( flask.url_for('view_commit',
' '%s%s