Skip to content

Commit

Permalink
In-line if/else for commit_with_author author
Browse files Browse the repository at this point in the history
  • Loading branch information
teward committed Apr 21, 2017
1 parent ac05a2b commit 8e0add7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions globalvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,10 @@ class GlobalVars:
commit = git_commit_info()
if md5(commit['author'][0].encode('utf-8')).hexdigest() in censored_committer_names:
commit['author'] = censored_committer_names[md5(commit['author'][0].encode('utf-8')).hexdigest()]
commit_with_author = "%s (%s: *%s*)" % (commit['id'], commit['author'], commit['message'])
else:
commit_with_author = "%s (%s: *%s*)" % (commit['id'], commit['author'][0], commit['message'])

commit_with_author = "%s (%s: *%s*)" % (commit['id'],
commit['author'][0] if type(commit['author']) is list else commit['author'],
commit['message'])

on_master = "HEAD detached" not in git_status()
charcoal_hq = None
Expand Down

0 comments on commit 8e0add7

Please sign in to comment.