@@ -222,13 +222,13 @@ def _env_without_git():
222222 return {k : v for k , v in os .environ .items () if not k .startswith ("GIT_" )}
223223
224224
225- def _git (args , cwd , timeout = 60 ):
225+ def run_git (args , cwd , timeout = 60 ):
226226 return subprocess .run (["git" , * args ], capture_output = True , text = True , cwd = cwd , timeout = timeout , check = False , env = _env_without_git ())
227227
228228
229229def _merge_base (cwd , branch ):
230230 for ref in (branch , f"origin/{ branch } " ):
231- r = _git (["merge-base" , ref , "HEAD" ], cwd )
231+ r = run_git (["merge-base" , ref , "HEAD" ], cwd )
232232 if r .returncode == 0 and r .stdout .strip ():
233233 return r .stdout .strip ()
234234 return None
@@ -252,12 +252,12 @@ def get_changed_files(root_dir, compare_branch="master", explicit: Optional[str]
252252 try :
253253 base = _merge_base (root_dir , compare_branch )
254254 if base is None :
255- _git (["fetch" , "origin" , f"{ compare_branch } :{ compare_branch } " , "--depth=1" ], root_dir , 120 )
256- _git (["fetch" , "--deepen=200" ], root_dir , 120 )
255+ run_git (["fetch" , "origin" , f"{ compare_branch } :{ compare_branch } " , "--depth=1" ], root_dir , 120 )
256+ run_git (["fetch" , "--deepen=200" ], root_dir , 120 )
257257 base = _merge_base (root_dir , compare_branch )
258258 if base is None :
259259 return None
260- diff = _git (["diff" , base , "HEAD" , "--name-only" , "--no-color" ], root_dir )
260+ diff = run_git (["diff" , base , "HEAD" , "--name-only" , "--no-color" ], root_dir )
261261 if diff .returncode != 0 :
262262 return None
263263 return {f for f in diff .stdout .splitlines () if f .strip ()}
0 commit comments