зеркало из https://github.com/microsoft/git.git
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:
Коммит
5071cb78a3
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче