From: Junio C Hamano Date: Mon, 27 Mar 2017 17:59:25 +0000 (-0700) Subject: Merge branch 'jc/lint-runaway-here-doc' X-Git-Tag: v2.13.0-rc0~68 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/09fb53568e3e00e30891b118045aa07ede524103?ds=inline;hp=-c Merge branch 'jc/lint-runaway-here-doc' The test framework learned to detect unterminated here documents. * jc/lint-runaway-here-doc: tests: lint for run-away here-doc --- 09fb53568e3e00e30891b118045aa07ede524103 diff --combined t/test-lib.sh index 23c29bce6e,d5f2b70bce..13b5696822 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -342,7 -342,6 +342,7 @@@ f exec 5>&1 exec 6<&0 +exec 7>&2 if test "$verbose_log" = "t" then exec 3>>"$GIT_TEST_TEE_OUTPUT_FILE" 4>&3 @@@ -625,9 -624,9 +625,9 @@@ test_run_ () trace= # 117 is magic because it is unlikely to match the exit # code of other programs - test_eval_ "(exit 117) && $1" - if test "$?" != 117; then - error "bug in the test script: broken &&-chain: $1" + if test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)" + then + error "bug in the test script: broken &&-chain or run-away HERE-DOC: $1" fi trace=$trace_tmp fi