ソースを参照

Update general.py check_git_status() fix (#2020)

5.0
Glenn Jocher GitHub 3年前
コミット
3b7feeafdf
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更3行の追加3行の削除
  1. +3
    -3
      utils/general.py

+ 3
- 3
utils/general.py ファイルの表示

@@ -65,9 +65,9 @@ def check_git_status():
assert not Path('/workspace').exists(), 'skipping check (Docker image)' # not Path('/.dockerenv').exists()
assert check_online(), 'skipping check (offline)'

cmd = 'git fetch && git config --get remote.origin.url' # github repo url
url = subprocess.check_output(cmd, shell=True).decode().rstrip()
branch = subprocess.check_output('git branch --show-current', shell=True).decode().rstrip() # current
cmd = 'git fetch && git config --get remote.origin.url'
url = subprocess.check_output(cmd, shell=True).decode().strip().rstrip('.git') # github repo url
branch = subprocess.check_output('git rev-parse --abbrev-ref HEAD', shell=True).decode().strip() # checked out
n = int(subprocess.check_output(f'git rev-list {branch}..origin/master --count', shell=True)) # commits behind
if n > 0:
s = f"⚠️ WARNING: code is out of date by {n} commit{'s' * (n > 1)}. " \

読み込み中…
キャンセル
保存