diffcore-pickaxe: respect --no-textconv
git log -S doesn't respect --no-textconv: $ echo '*.txt diff=wrong' > .gitattributes $ git -c diff.wrong.textconv='xxx' log --no-textconv -Sfoo error: cannot run xxx: No such file or directory fatal: unable to read files to diff Reported-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Simon Ruderich <simon@ruderich.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7cdb9b42c3
commit
a8f6109428
@ -86,8 +86,10 @@ static int diff_grep(struct diff_filepair *p, struct diff_options *o,
|
|||||||
if (diff_unmodified_pair(p))
|
if (diff_unmodified_pair(p))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
textconv_one = get_textconv(p->one);
|
if (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) {
|
||||||
textconv_two = get_textconv(p->two);
|
textconv_one = get_textconv(p->one);
|
||||||
|
textconv_two = get_textconv(p->two);
|
||||||
|
}
|
||||||
|
|
||||||
mf1.size = fill_textconv(textconv_one, p->one, &mf1.ptr);
|
mf1.size = fill_textconv(textconv_one, p->one, &mf1.ptr);
|
||||||
mf2.size = fill_textconv(textconv_two, p->two, &mf2.ptr);
|
mf2.size = fill_textconv(textconv_two, p->two, &mf2.ptr);
|
||||||
@ -201,8 +203,10 @@ static int has_changes(struct diff_filepair *p, struct diff_options *o,
|
|||||||
if (!o->pickaxe[0])
|
if (!o->pickaxe[0])
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
textconv_one = get_textconv(p->one);
|
if (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) {
|
||||||
textconv_two = get_textconv(p->two);
|
textconv_one = get_textconv(p->one);
|
||||||
|
textconv_two = get_textconv(p->two);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have an unmodified pair, we know that the count will be the
|
* If we have an unmodified pair, we know that the count will be the
|
||||||
|
@ -80,6 +80,20 @@ test_expect_success 'log -G -i (match)' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'log -G --textconv (missing textconv tool)' '
|
||||||
|
echo "* diff=test" >.gitattributes &&
|
||||||
|
test_must_fail git -c diff.test.textconv=missing log -Gfoo &&
|
||||||
|
rm .gitattributes
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'log -G --no-textconv (missing textconv tool)' '
|
||||||
|
echo "* diff=test" >.gitattributes &&
|
||||||
|
git -c diff.test.textconv=missing log -Gfoo --no-textconv >actual &&
|
||||||
|
>expect &&
|
||||||
|
test_cmp expect actual &&
|
||||||
|
rm .gitattributes
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'log -S (nomatch)' '
|
test_expect_success 'log -S (nomatch)' '
|
||||||
git log -Spicked --format=%H >actual &&
|
git log -Spicked --format=%H >actual &&
|
||||||
>expect &&
|
>expect &&
|
||||||
@ -116,4 +130,18 @@ test_expect_success 'log -S -i (nomatch)' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'log -S --textconv (missing textconv tool)' '
|
||||||
|
echo "* diff=test" >.gitattributes &&
|
||||||
|
test_must_fail git -c diff.test.textconv=missing log -Sfoo &&
|
||||||
|
rm .gitattributes
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'log -S --no-textconv (missing textconv tool)' '
|
||||||
|
echo "* diff=test" >.gitattributes &&
|
||||||
|
git -c diff.test.textconv=missing log -Sfoo --no-textconv >actual &&
|
||||||
|
>expect &&
|
||||||
|
test_cmp expect actual &&
|
||||||
|
rm .gitattributes
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user