@@ -76,7 +76,7 @@ def hook_path(name: str, git_dir: PathLike) -> str:
7676return osp .join (git_dir ,"hooks" ,name )
7777
7878
79- def _has_file_extension (path ) :
79+ def _has_file_extension (path : str ) -> str :
8080return osp .splitext (path )[1 ]
8181
8282
@@ -102,7 +102,7 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
102102relative_hp = Path (hp ).relative_to (index .repo .working_dir ).as_posix ()
103103cmd = ["bash.exe" ,relative_hp ]
104104
105- cmd = subprocess .Popen (
105+ process = subprocess .Popen (
106106cmd + list (args ),
107107env = env ,
108108stdout = subprocess .PIPE ,
@@ -116,13 +116,13 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
116116else :
117117stdout_list :List [str ]= []
118118stderr_list :List [str ]= []
119- handle_process_output (cmd ,stdout_list .append ,stderr_list .append ,finalize_process )
119+ handle_process_output (process ,stdout_list .append ,stderr_list .append ,finalize_process )
120120stdout = "" .join (stdout_list )
121121stderr = "" .join (stderr_list )
122- if cmd .returncode != 0 :
122+ if process .returncode != 0 :
123123stdout = force_text (stdout ,defenc )
124124stderr = force_text (stderr ,defenc )
125- raise HookExecutionError (hp ,cmd .returncode ,stderr ,stdout )
125+ raise HookExecutionError (hp ,process .returncode ,stderr ,stdout )
126126# end handle return code
127127
128128
@@ -394,7 +394,6 @@ def aggressive_tree_merge(odb: "GitCmdObjectDB", tree_shas: Sequence[bytes]) ->
394394out .append (_tree_entry_to_baseindexentry (theirs ,0 ))
395395# END handle modification
396396else :
397-
398397if ours [0 ]!= base [0 ]or ours [1 ]!= base [1 ]:
399398# they deleted it, we changed it, conflict
400399out .append (_tree_entry_to_baseindexentry (base ,1 ))