t7201: fix &&-chain breakage

One of these breakages is in setup, but one is more severe and may miss a real test failure. These are pulled out from the rest, though, because we also clean up a few other anachronisms. The most interesting is the use of this here-doc construct: (cat >... <<EOF ... EOF ) && It looks like an attempt to make the &&-chaining more natural by letting it come at the end of the here-doc. But the extra sub-shell is so non-idiomatic (plus the lack of "<<-") that it ends up confusing. Since these are just using a single line, we can accomplish the same thing with a single printf (which also makes the use of tab more obvious than the verbatim whitespace). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 20, 2015 at 06:12 UTC aef591a0f91a80d2b39c5344653861967d70d720
1 file changed +6 -13
t/t7201-co.sh
+6 -13
@@ -88,14 +88,10 @@ test_expect_success "checkout with unrelated dirty tree without -m" '
88
89 git checkout -f master &&
90 fill 0 1 2 3 4 5 6 7 8 >same &&
91 - cp same kept
91 + cp same kept &&
92 git checkout side >messages &&
93 - test_cmp same kept
94 - (cat > messages.expect <<EOF
95 -M same
96 -EOF
97 -) &&
98 - touch messages.expect &&
93 + test_cmp same kept &&
94 + printf "M\t%s\n" same >messages.expect &&
95 test_cmp messages.expect messages
96 '
97
@@ -109,10 +105,7 @@ test_expect_success "checkout -m with dirty tree" '
105
106 test "$(git symbolic-ref HEAD)" = "refs/heads/side" &&
107
112 - (cat >expect.messages <<EOF
113 -M one
114 -EOF
115 -) &&
108 + printf "M\t%s\n" one >expect.messages &&
109 test_cmp expect.messages messages &&
110
111 fill "M one" "A three" "D two" >expect.master &&
@@ -409,12 +402,12 @@ test_expect_success \
402
403 test_expect_success \
404 'checkout w/autosetupmerge=always sets up tracking' '
405 + test_when_finished git config branch.autosetupmerge false &&
406 git config branch.autosetupmerge always &&
407 git checkout master &&
408 git checkout -b track2 &&
409 test "$(git config branch.track2.remote)" &&
416 - test "$(git config branch.track2.merge)"
417 - git config branch.autosetupmerge false'
410 + test "$(git config branch.track2.merge)"'
411
412 test_expect_success 'checkout w/--track from non-branch HEAD fails' '
413 git checkout master^0 &&