Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5206ce2

Browse files
author
Sebastien Chemin
committed
Fix file stashing with external diff tool
When git is configured to use an external diff tool to show diffs (eg. 'git config diff.external mytool'), the stashing unstaged files will create an empty file that can't be recovered. Some modifications are permanently lost... Just disable the ext-diff of git diff to avoid any issue. Change-Id: I10a57ac2acbcb1f7219455f1958efd50d8452d6a
1 parent 9c6484b commit 5206ce2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pre_commit/staged_files_only.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def staged_files_only(cmd_runner):
2323
retcode, diff_stdout_binary, _ = cmd_runner.run(
2424
[
2525
'git', 'diff', '--ignore-submodules', '--binary', '--exit-code',
26-
'--no-color',
26+
'--no-color', '--no-ext-diff',
2727
],
2828
retcode=None,
2929
encoding=None,

0 commit comments

Comments
 (0)