Narrow the old head's type in chunk-pr push

This commit is contained in:
2026-11-27 15:16:51 +01:00
parent 32aee19da2
commit ccc5e8a830
2 changed files with 14 additions and 1 deletions
+3 -1
View File
@@ -376,7 +376,9 @@ def pushed(run: Run, config: Config, sleep: typing.Callable[[float], None]) -> s
return found
forge, branch, head = found
old = run(["git", "ls-remote", "origin", f"refs/heads/{branch}"])
sent = old if isinstance(old, Failure) else run(["git", "push", "--quiet", "--set-upstream", "origin", branch])
if isinstance(old, Failure):
return old
sent = run(["git", "push", "--quiet", "--set-upstream", "origin", branch])
number = sent if isinstance(sent, Failure) else shown_pull(forge, branch, head, old.split()[0] if old.strip() else "", run, sleep)
if isinstance(number, Failure):
return number