summaryrefslogtreecommitdiffstats
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-13 23:44:48 +0100
committerJunio C Hamano <gitster@pobox.com>2024-02-13 23:44:48 +0100
commit5071cb78a31b75e007b36f7edb4a4daa59cf3138 (patch)
tree1549230b35a62441783453c114d5736ee56fe363 /diff.c
parentMerge branch 'rs/parse-options-with-keep-unknown-abbrev-fix' into maint-2.43 (diff)
parentdiff: handle NULL meta-info when spawning external diff (diff)
downloadgit-5071cb78a31b75e007b36f7edb4a4daa59cf3138.tar.xz
git-5071cb78a31b75e007b36f7edb4a4daa59cf3138.zip
Merge branch 'jk/diff-external-with-no-index' into maint-2.43
"git diff --no-index file1 file2" segfaulted while invoking the external diff driver, which has been corrected. * jk/diff-external-with-no-index: diff: handle NULL meta-info when spawning external diff
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index a89a6a6128..ccfa1fca0d 100644
--- a/diff.c
+++ b/diff.c
@@ -4384,7 +4384,8 @@ static void run_external_diff(const char *pgm,
add_external_diff_name(o->repo, &cmd.args, two);
if (other) {
strvec_push(&cmd.args, other);
- strvec_push(&cmd.args, xfrm_msg);
+ if (xfrm_msg)
+ strvec_push(&cmd.args, xfrm_msg);
}
}