Skip to content

Commit 3e7719a

Browse files
authored
Merge pull request #11 from dolphin-emu/git-error
git: Add --force argument to second fetch command
2 parents 50c29d4 + 2e0fe75 commit 3e7719a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

central/git.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ def git_cli(self, *args):
3636
"GIT_COMMITTER_EMAIL": "[email protected]",
3737
}
3838
logging.debug("[%s] running git command: %s", self.path, args)
39-
out = subprocess.run(
40-
(self.git_path,) + args,
41-
cwd=self.path,
42-
check=True,
43-
env=env,
44-
capture_output=True,
45-
)
39+
40+
try:
41+
out = subprocess.run(
42+
(self.git_path,) + args,
43+
cwd=self.path,
44+
check=True,
45+
env=env,
46+
capture_output=True,
47+
)
48+
except subprocess.CalledProcessError as e:
49+
logging.error("git command failed with stderr: %s" % e.stderr)
50+
raise
51+
4652
return out.stdout.decode("utf-8").strip()
4753

4854
def clone(self, origin):
@@ -51,7 +57,7 @@ def clone(self, origin):
5157
def fetch(self):
5258
self.git_cli("fetch", "--all", "--tags", "--prune")
5359
self.git_cli("update-ref", "HEAD", "FETCH_HEAD")
54-
self.git_cli("fetch", "origin", "refs/heads/*:refs/heads/*")
60+
self.git_cli("fetch", "--force", "origin", "refs/heads/*:refs/heads/*")
5561

5662
def commit_log(self, hash, format):
5763
return self.git_cli("log", "-1", f"--format=format:{format}", hash)

0 commit comments

Comments
 (0)