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
This commit is contained in:
Junio C Hamano
2024-02-13 14:44:48 -08:00
2 changed files with 14 additions and 1 deletions

3
diff.c
View File

@@ -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);
}
}