@@ -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