[PATCH 04/29] t3303: use standard here-doc tag "EOF" to avoid fooling --chain-lint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



An upcoming change will teach --chain-lint to detect &&-chain breakage
inside subshells. The check works by performing textual transformations
on the test to link the subshell body directly into the parent's
&&-chain. Special care is taken with the final statement in a
subshell. For instance:

    statement1 &&
    (
        statement2
    ) &&
    statement3

is transformed to:

    statement1 &&
    statement2 &&
    statement3

Notice that "statement2" gains a "&&".

Special care is is taken with here-docs since "&&" needs to be added to
the "<<EOF" line which opens the here-doc, not the "EOF" line which
closes it. For practical reasons (namely, transformations are performed
line-by-line), only here-docs tagged with "EOF" are recognized.

Signed-off-by: Eric Sunshine <sunshine@xxxxxxxxxxxxxx>
---
 t/t3303-notes-subtrees.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh
index 704aee81ef..e353faa50b 100755
--- a/t/t3303-notes-subtrees.sh
+++ b/t/t3303-notes-subtrees.sh
@@ -39,7 +39,7 @@ test_expect_success "setup: create $number_of_commits commits" '
 		while [ $nr -lt $number_of_commits ]; do
 			nr=$(($nr+1)) &&
 			test_tick &&
-			cat <<INPUT_END
+			cat <<EOF
 commit refs/heads/master
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
@@ -47,15 +47,15 @@ commit #$nr
 COMMIT
 
 M 644 inline file
-data <<EOF
+data <<DATA
 file in commit #$nr
-EOF
+DATA
 
-INPUT_END
+EOF
 
 		done &&
 		test_tick &&
-		cat <<INPUT_END
+		cat <<EOF
 commit refs/notes/commits
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 data <<COMMIT
@@ -64,7 +64,7 @@ COMMIT
 
 deleteall
 
-INPUT_END
+EOF
 
 	) |
 	git fast-import --quiet &&
-- 
2.18.0.419.gfe4b301394




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux