From 71b6e5affa107e1c45ada7261b1444a684f44f6f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 09 2016 14:24:25 +0000 Subject: Fix the git blame view when the committer has no name In the git tree of the linux kernel, the commit `febf7ea4bedcd36fba0843db726bba28d22bf89a` has for author ``Author: `` which, as you can see, has no name specified. This makes pygit2 un-happy and basically makes it crash. In this commit, we work around the issue by not specifying an user if the committer did not use one. --- diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index 1226d22..4f7efdb 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -291,9 +291,14 @@ def blame_loc(loc, repo, username, blame): % ({'cnt': idx + 1}) ) + committer = None + try: + committer = diff.orig_committer + except ValueError: + pass output.append( - '%s' % author_to_user( - diff.orig_committer, with_name=False) + '%s' % (author_to_user( + committer, with_name=False) if committer else ' ') ) output.append(