@@ -66,25 +66,14 @@ def run_command(command: str, *args: str, ignore_error: bool = False) -> Optiona
6666
6767def require_clean_and_up_to_date_repo () -> None :
6868 """Checks if the repo is clean and up to date with any important branches."""
69- if not is_repo_clean_and_up_to_date ():
70- typer .secho ("The repo is either not clean or is not up to date." , fg = "red" )
71- raise typer .Exit (code = 1 )
72-
73-
74- def is_repo_clean_and_up_to_date () -> bool :
75- """Checks if the repo is clean and up to date with any important branches."""
76- try :
77- git ("fetch" )
78- git ("status" , "--porcelain" )
79- if not is_branch_synced_with_remote ("develop" ):
80- raise ValueError ("develop is not synced with origin/develop" )
81- if not is_branch_synced_with_remote ("main" ):
82- raise ValueError ("main is not synced with origin/main" )
83- if not is_ancestor ("main" , "develop" ):
84- raise ValueError ("main is not an ancestor of develop" )
85- return True
86- except subprocess .CalledProcessError :
87- return False
69+ git ("fetch" )
70+ git ("status" , "--porcelain" )
71+ if not is_branch_synced_with_remote ("develop" ):
72+ raise ValueError ("develop is not synced with origin/develop" )
73+ if not is_branch_synced_with_remote ("main" ):
74+ raise ValueError ("main is not synced with origin/main" )
75+ if not is_ancestor ("main" , "develop" ):
76+ raise ValueError ("main is not an ancestor of develop" )
8877
8978
9079def is_branch_synced_with_remote (branch : str ) -> bool :
0 commit comments