From 051e9e80def4c8bc28e4241df2a801c6aa6a8d33 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 13 Jan 2021 10:25:53 -0800 Subject: [PATCH] check_git_status() bug fix (#1925) --- utils/general.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/utils/general.py b/utils/general.py index 5126a45ac096..3247b66da0ce 100755 --- a/utils/general.py +++ b/utils/general.py @@ -57,7 +57,7 @@ def check_online(): def check_git_status(): - # Suggest 'git pull' if YOLOv5 is out of date + # Recommend 'git pull' if code is out of date print(colorstr('github: '), end='') try: if Path('.git').exists() and check_online(): @@ -66,13 +66,12 @@ def check_git_status(): n = int(subprocess.check_output( 'git rev-list $(git rev-parse --abbrev-ref HEAD)..origin/master --count', shell=True)) # commits behind if n > 0: - s = f"⚠️ WARNING: code is out of date by {n} {'commits' if n > 1 else 'commmit'}. " \ - f"Use 'git pull' to update or 'git clone {url}' to download latest." + print(f"⚠️ WARNING: code is out of date by {n} {'commits' if n > 1 else 'commmit'}. " + f"Use 'git pull' to update or 'git clone {url}' to download latest.") else: - s = f'up to date with {url} ✅' + print(f'up to date with {url} ✅') except Exception as e: - s = str(e) - print(s) + print(e) def check_requirements(file='requirements.txt'):