[백업] Gitea 미러 갱신 시 git 출력이 결과 JSON에 섞여 실패하던 문제 수정
미러가 이미 있으면 git remote update가 'Fetching origin'을 stdout에 출력해 결과 JSON 파싱이 실패했다(첫 실행 이후 매번 gitea 단계 실패). git 하위 프로세스의 stdout을 stderr로 돌린다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -91,11 +91,11 @@ for repo in repos:
|
|||||||
env["GIT_TERMINAL_PROMPT"] = "0"
|
env["GIT_TERMINAL_PROMPT"] = "0"
|
||||||
|
|
||||||
if os.path.isdir(mirror_path):
|
if os.path.isdir(mirror_path):
|
||||||
subprocess.run(["git", "-C", mirror_path, "remote", "set-url", "origin", auth_url], check=True)
|
subprocess.run(["git", "-C", mirror_path, "remote", "set-url", "origin", auth_url], check=True, stdout=sys.stderr)
|
||||||
proc = subprocess.run(["git", "-C", mirror_path, "remote", "update", "--prune"], env=env)
|
proc = subprocess.run(["git", "-C", mirror_path, "remote", "update", "--prune"], env=env, stdout=sys.stderr)
|
||||||
action = "updated"
|
action = "updated"
|
||||||
else:
|
else:
|
||||||
proc = subprocess.run(["git", "clone", "--mirror", auth_url, mirror_path], env=env)
|
proc = subprocess.run(["git", "clone", "--mirror", auth_url, mirror_path], env=env, stdout=sys.stderr)
|
||||||
action = "cloned"
|
action = "cloned"
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user