From 1d953cc1ed3fa2abf0be69a56c072aefd284eae6 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 28 Jan 2020 12:41:34 -0800 Subject: [PATCH] Fix extra space when no commit_details but yes push_details. --- gitcheckup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gitcheckup.py b/gitcheckup.py index e9505ab..1ffab1f 100644 --- a/gitcheckup.py +++ b/gitcheckup.py @@ -119,15 +119,13 @@ def gitcheckup(do_fetch=False): if result.commit_details.deleted: commit_details.append(f'-{result.commit_details.deleted}') if result.commit_details.modified: commit_details.append(f'~{result.commit_details.modified}') commit_details = ', '.join(commit_details) - commit_details = f'({commit_details})' if commit_details else '' - details.append(commit_details) + if commit_details: details.append(f'({commit_details})') push_details = [] if result.push_details.to_push: push_details.append(f'↑{result.push_details.to_push}') if result.push_details.to_pull: push_details.append(f'↓{result.push_details.to_pull}') push_details = ', '.join(push_details) - push_details = f'({push_details})' if push_details else '' - details.append(push_details) + if push_details: details.append(f'({push_details})') details = ' '.join(details) details = (' ' + details).rstrip()