Answer stability round 1: 0 🔴, 3 🟡 (0 misread); pin the guarded default-branch reads and which commit an amend drops, and name the pass and its counted commits in the refusal
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ def default_ref(cwd: str | None = None, timeout: float | None = None, guarded: b
|
||||
recorded = git("symbolic-ref", "--short", "refs/remotes/origin/HEAD", cwd=cwd, guarded=guarded)
|
||||
if not isinstance(recorded, Failure):
|
||||
return recorded.strip()
|
||||
return Failure("origin records no default branch; set it with `git remote set-head origin --auto`") if guarded else origin_head(cwd, timeout)
|
||||
return Failure("origin records no default branch") if guarded else origin_head(cwd, timeout)
|
||||
for branch in ("main", "master"):
|
||||
if not isinstance(git("rev-parse", "--quiet", "--verify", f"refs/heads/{branch}", cwd=cwd, guarded=guarded), Failure):
|
||||
return branch
|
||||
|
||||
Reference in New Issue
Block a user