diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-11-21 15:14:38 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-21 15:14:38 -0800 |
commit | d5e35329dd5305d611478e8d5076a8ca75e25f0d (patch) | |
tree | 36042e52cfb5dc66fd01f355950ad3c7d21252b8 | |
parent | Merge branch 'jk/rev-parse-end-of-options' (diff) | |
parent | t7800: simplify difftool test (diff) | |
download | tgif-d5e35329dd5305d611478e8d5076a8ca75e25f0d.tar.xz |
Merge branch 'jk/diff-release-filespec-fix'
Running "git diff" while allowing external diff in a state with
unmerged paths used to segfault, which has been corrected.
* jk/diff-release-filespec-fix:
t7800: simplify difftool test
diff: allow passing NULL to diff_free_filespec_data()
-rw-r--r-- | diff.c | 3 | ||||
-rwxr-xr-x | t/t7800-difftool.sh | 13 |
2 files changed, 16 insertions, 0 deletions
@@ -4115,6 +4115,9 @@ void diff_free_filespec_blob(struct diff_filespec *s) void diff_free_filespec_data(struct diff_filespec *s) { + if (!s) + return; + diff_free_filespec_blob(s); FREE_AND_NULL(s->cnt_data); } diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index 524f30f7dc..a578b35761 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -728,6 +728,19 @@ test_expect_success 'add -N and difftool -d' ' git difftool --dir-diff --extcmd ls ' +test_expect_success 'difftool --cached with unmerged files' ' + test_when_finished git reset --hard && + + test_commit conflicting && + test_commit conflict-a conflict.t a && + git reset --hard conflicting && + test_commit conflict-b conflict.t b && + test_must_fail git merge conflict-a && + + git difftool --cached --no-prompt >output && + test_must_be_empty output +' + test_expect_success 'outside worktree' ' echo 1 >1 && echo 2 >2 && |