From: Junio C Hamano Date: Fri, 9 Sep 2022 19:02:24 +0000 (-0700) Subject: Merge branch 'js/add-p-diff-parsing-fix' X-Git-Tag: v2.38.0-rc0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb094cb583e9e0f3842a6c445ccf84455cf17136;p=thirdparty%2Fgit.git Merge branch 'js/add-p-diff-parsing-fix' Those who use diff-so-fancy as the diff-filter noticed a regression or two in the code that parses the diff output in the built-in version of "add -p", which has been corrected. * js/add-p-diff-parsing-fix: add -p: ignore dirty submodules add -p: gracefully handle unparseable hunk headers in colored diffs add -p: detect more mismatches between plain vs colored diffs --- fb094cb583e9e0f3842a6c445ccf84455cf17136 diff --cc t/t3701-add-interactive.sh index 3b7df9bed5,b6b309414e..5a7a0ea7e8 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@@ -761,24 -761,22 +761,35 @@@ test_expect_success 'detect bogus diffF git reset --hard && echo content >test && - test_config interactive.diffFilter "sed 1d" && + test_config interactive.diffFilter "sed 6d" && printf y >y && - force_color test_must_fail git add -p output 2>&1 && + grep "mismatched output" output + ' + + test_expect_success 'handle iffy colored hunk headers' ' + git reset --hard && + + echo content >test && + printf n >n && + force_color git -c interactive.diffFilter="sed s/.*@@.*/XX/" \ + add -p >output 2>&1 test && + test_config interactive.diffFilter cat && + printf y >y && + force_color git add -p >output 2>&1