From 86ba3b7a890223751c563e83ea779eabc4ab9a37 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Mon, 15 Sep 2025 23:19:43 +0000 Subject: [PATCH 1/2] git: Log stderr when git command fails --- central/git.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/central/git.py b/central/git.py index 0d31358..e1ee3b6 100644 --- a/central/git.py +++ b/central/git.py @@ -36,13 +36,19 @@ class GitRepository: "GIT_COMMITTER_EMAIL": "central@dolphin-emu.org", } logging.debug("[%s] running git command: %s", self.path, args) - out = subprocess.run( - (self.git_path,) + args, - cwd=self.path, - check=True, - env=env, - capture_output=True, - ) + + try: + out = subprocess.run( + (self.git_path,) + args, + cwd=self.path, + check=True, + env=env, + capture_output=True, + ) + except subprocess.CalledProcessError as e: + logging.error("git command failed with stderr: %s" % e.stderr) + raise + return out.stdout.decode("utf-8").strip() def clone(self, origin): From 2e0fe752c8e3c8ae37f07fde3738a384bfd3d022 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Mon, 15 Sep 2025 23:40:29 +0000 Subject: [PATCH 2/2] git: Add --force argument to second fetch command --- central/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/central/git.py b/central/git.py index e1ee3b6..0b6dc17 100644 --- a/central/git.py +++ b/central/git.py @@ -57,7 +57,7 @@ class GitRepository: def fetch(self): self.git_cli("fetch", "--all", "--tags", "--prune") self.git_cli("update-ref", "HEAD", "FETCH_HEAD") - self.git_cli("fetch", "origin", "refs/heads/*:refs/heads/*") + self.git_cli("fetch", "--force", "origin", "refs/heads/*:refs/heads/*") def commit_log(self, hash, format): return self.git_cli("log", "-1", f"--format=format:{format}", hash)