mirror of
https://github.com/git/git
synced 2024-11-05 04:53:18 +00:00
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:
commit
5071cb78a3
2 changed files with 14 additions and 1 deletions
3
diff.c
3
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -205,6 +205,18 @@ test_expect_success POSIXPERM,SYMLINKS 'diff --no-index normalizes: mode not lik
|
|||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success POSIXPERM 'external diff with mode-only change' '
|
||||
echo content >not-executable &&
|
||||
echo content >executable &&
|
||||
chmod +x executable &&
|
||||
echo executable executable $(test_oid zero) 100755 \
|
||||
not-executable $(test_oid zero) 100644 not-executable \
|
||||
>expect &&
|
||||
test_expect_code 1 git -c diff.external=echo diff \
|
||||
--no-index executable not-executable >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success "diff --no-index treats '-' as stdin" '
|
||||
cat >expect <<-EOF &&
|
||||
diff --git a/- b/a/1
|
||||
|
|
Loading…
Reference in a new issue