Give each review pass at most two rounds per chunk, with no third round and no ask for one
This commit is contained in:
@@ -6,7 +6,7 @@ import sys
|
||||
import typing
|
||||
|
||||
from rule_hook.rules import Breach
|
||||
from rule_hook.git import existing, git
|
||||
from rule_hook.git import existing, git, local_default_branch
|
||||
from failure import Failure
|
||||
from utc_stamp import utc
|
||||
|
||||
@@ -119,9 +119,5 @@ def unread_reflog(reflog: str | Failure, head: str | Failure) -> Failure | None:
|
||||
return None if head in reflog.split() else Failure("it does not hold HEAD")
|
||||
|
||||
|
||||
def local_default_branch(directory: str) -> str | None:
|
||||
return next((name for name in ("origin/HEAD", "main", "master") if not isinstance(git(directory, "rev-parse", "--verify", "--quiet", name), Failure)), None)
|
||||
|
||||
|
||||
def holds(directory: str, descendant: str, ancestor: str) -> bool:
|
||||
return bool(ancestor) and not isinstance(git(directory, "merge-base", "--is-ancestor", ancestor, descendant), Failure)
|
||||
|
||||
Reference in New Issue
Block a user