Merge branch 'jc/lint-runaway-here-doc'
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Mar 2017 17:59:25 +0000 (10:59 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Mar 2017 17:59:25 +0000 (10:59 -0700)
The test framework learned to detect unterminated here documents.

* jc/lint-runaway-here-doc:
tests: lint for run-away here-doc

1  2 
t/test-lib.sh
diff --combined t/test-lib.sh
index 23c29bce6edbb5b921145e80849600896c2e1e3f,d5f2b70bce53227a47a73ec8e78abaeb9e3c6436..13b5696822d7cd054ed00cd5b4111ab39d3606cb
@@@ -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