glenn-jocher
commited on
Commit
•
3b7feea
1
Parent(s):
aac33f8
Update general.py check_git_status() fix (#2020)
Browse files- utils/general.py +3 -3
utils/general.py
CHANGED
@@ -65,9 +65,9 @@ def check_git_status():
|
|
65 |
assert not Path('/workspace').exists(), 'skipping check (Docker image)' # not Path('/.dockerenv').exists()
|
66 |
assert check_online(), 'skipping check (offline)'
|
67 |
|
68 |
-
cmd = 'git fetch && git config --get remote.origin.url'
|
69 |
-
url = subprocess.check_output(cmd, shell=True).decode().rstrip()
|
70 |
-
branch = subprocess.check_output('git
|
71 |
n = int(subprocess.check_output(f'git rev-list {branch}..origin/master --count', shell=True)) # commits behind
|
72 |
if n > 0:
|
73 |
s = f"⚠️ WARNING: code is out of date by {n} commit{'s' * (n > 1)}. " \
|
|
|
65 |
assert not Path('/workspace').exists(), 'skipping check (Docker image)' # not Path('/.dockerenv').exists()
|
66 |
assert check_online(), 'skipping check (offline)'
|
67 |
|
68 |
+
cmd = 'git fetch && git config --get remote.origin.url'
|
69 |
+
url = subprocess.check_output(cmd, shell=True).decode().strip().rstrip('.git') # github repo url
|
70 |
+
branch = subprocess.check_output('git rev-parse --abbrev-ref HEAD', shell=True).decode().strip() # checked out
|
71 |
n = int(subprocess.check_output(f'git rev-list {branch}..origin/master --count', shell=True)) # commits behind
|
72 |
if n > 0:
|
73 |
s = f"⚠️ WARNING: code is out of date by {n} commit{'s' * (n > 1)}. " \
|