@@ -76,7 +76,7 @@ def hook_path(name: str, git_dir: PathLike) -> str:
76
76
return osp .join (git_dir , "hooks" , name )
77
77
78
78
79
- def _has_file_extension (path ) :
79
+ def _has_file_extension (path : str ) -> str :
80
80
return osp .splitext (path )[1 ]
81
81
82
82
@@ -102,7 +102,7 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
102
102
relative_hp = Path (hp ).relative_to (index .repo .working_dir ).as_posix ()
103
103
cmd = ["bash.exe" , relative_hp ]
104
104
105
- cmd = subprocess .Popen (
105
+ process = subprocess .Popen (
106
106
cmd + list (args ),
107
107
env = env ,
108
108
stdout = subprocess .PIPE ,
@@ -116,13 +116,13 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
116
116
else :
117
117
stdout_list : List [str ] = []
118
118
stderr_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 )
120
120
stdout = "" .join (stdout_list )
121
121
stderr = "" .join (stderr_list )
122
- if cmd .returncode != 0 :
122
+ if process .returncode != 0 :
123
123
stdout = force_text (stdout , defenc )
124
124
stderr = force_text (stderr , defenc )
125
- raise HookExecutionError (hp , cmd .returncode , stderr , stdout )
125
+ raise HookExecutionError (hp , process .returncode , stderr , stdout )
126
126
# end handle return code
127
127
128
128
@@ -394,7 +394,6 @@ def aggressive_tree_merge(odb: "GitCmdObjectDB", tree_shas: Sequence[bytes]) ->
394
394
out .append (_tree_entry_to_baseindexentry (theirs , 0 ))
395
395
# END handle modification
396
396
else :
397
-
398
397
if ours [0 ] != base [0 ] or ours [1 ] != base [1 ]:
399
398
# they deleted it, we changed it, conflict
400
399
out .append (_tree_entry_to_baseindexentry (base , 1 ))
0 commit comments