@@ -32,7 +32,8 @@ def _hook_msg_start(hook, verbose):
3232
3333def get_changed_files (new , old ):
3434 return cmd_output (
35- 'git' , 'diff' , '--name-only' , '{}...{}' .format (old , new ),
35+ 'git' , 'diff' , '--no-ext-diff' , '--name-only' ,
36+ '{}...{}' .format (old , new ),
3637 )[1 ].splitlines ()
3738
3839
@@ -85,12 +86,16 @@ def _run_single_hook(hook, repo, args, skips, cols):
8586 ))
8687 sys .stdout .flush ()
8788
88- diff_before = cmd_output ('git' , 'diff' , retcode = None , encoding = None )
89+ diff_before = cmd_output (
90+ 'git' , 'diff' , '--no-ext-diff' , retcode = None , encoding = None ,
91+ )
8992 retcode , stdout , stderr = repo .run_hook (
9093 hook ,
9194 tuple (filenames ) if hook ['pass_filenames' ] else (),
9295 )
93- diff_after = cmd_output ('git' , 'diff' , retcode = None , encoding = None )
96+ diff_after = cmd_output (
97+ 'git' , 'diff' , '--no-ext-diff' , retcode = None , encoding = None ,
98+ )
9499
95100 file_modifications = diff_before != diff_after
96101
@@ -159,10 +164,10 @@ def _run_hooks(repo_hooks, args, environ):
159164 if (
160165 retval and
161166 args .show_diff_on_failure and
162- subprocess .call (('git' , 'diff' , '--quiet' )) != 0
167+ subprocess .call (('git' , 'diff' , '--quiet' , '--no-ext-diff' )) != 0
163168 ):
164169 print ('All changes made by hooks:' )
165- subprocess .call (('git' , 'diff' ))
170+ subprocess .call (('git' , 'diff' , '--no-ext-diff' ))
166171 return retval
167172
168173
@@ -179,7 +184,10 @@ def _has_unmerged_paths(runner):
179184
180185def _has_unstaged_config (runner ):
181186 retcode , _ , _ = runner .cmd_runner .run (
182- ('git' , 'diff' , '--exit-code' , runner .config_file_path ),
187+ (
188+ 'git' , 'diff' , '--no-ext-diff' , '--exit-code' ,
189+ runner .config_file_path ,
190+ ),
183191 retcode = None ,
184192 )
185193 # be explicit, other git errors don't mean it has an unstaged config.
0 commit comments