File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -4115,6 +4115,9 @@ void diff_free_filespec_blob(struct diff_filespec *s)
41154115
41164116void diff_free_filespec_data (struct diff_filespec * s )
41174117{
4118+ if (!s )
4119+ return ;
4120+
41184121 diff_free_filespec_blob (s );
41194122 FREE_AND_NULL (s -> cnt_data );
41204123}
Original file line number Diff line number Diff line change @@ -728,6 +728,19 @@ test_expect_success 'add -N and difftool -d' '
728728 git difftool --dir-diff --extcmd ls
729729'
730730
731+ test_expect_success ' difftool --cached with unmerged files' '
732+ test_when_finished git reset --hard &&
733+
734+ test_commit conflicting &&
735+ test_commit conflict-a conflict.t a &&
736+ git reset --hard conflicting &&
737+ test_commit conflict-b conflict.t b &&
738+ test_must_fail git merge conflict-a &&
739+
740+ git difftool --cached --no-prompt >output &&
741+ test_must_be_empty output
742+ '
743+
731744test_expect_success ' outside worktree' '
732745 echo 1 >1 &&
733746 echo 2 >2 &&
You can’t perform that action at this time.
0 commit comments