aboutsummaryrefslogtreecommitdiff
path: root/t/t7201-co.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-03-20 06:12:55 -0400
committerJunio C Hamano <gitster@pobox.com>2015-03-20 10:20:17 -0700
commitaef591a0f91a80d2b39c5344653861967d70d720 (patch)
tree470f0a16d12391b58b352f2f338f378aed06835e /t/t7201-co.sh
parent27a6625b13d7475d28f425adb2b7be221cf3c8e0 (diff)
downloadgit-aef591a0f91a80d2b39c5344653861967d70d720.tar.gz
git-aef591a0f91a80d2b39c5344653861967d70d720.tar.xz
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>
Diffstat (limited to 't/t7201-co.sh')
-rwxr-xr-xt/t7201-co.sh19
1 files changed, 6 insertions, 13 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index a7fe4e675..885923610 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -88,14 +88,10 @@ test_expect_success "checkout with unrelated dirty tree without -m" '
git checkout -f master &&
fill 0 1 2 3 4 5 6 7 8 >same &&
- cp same kept
+ cp same kept &&
git checkout side >messages &&
- test_cmp same kept
- (cat > messages.expect <<EOF
-M same
-EOF
-) &&
- touch messages.expect &&
+ test_cmp same kept &&
+ printf "M\t%s\n" same >messages.expect &&
test_cmp messages.expect messages
'
@@ -109,10 +105,7 @@ test_expect_success "checkout -m with dirty tree" '
test "$(git symbolic-ref HEAD)" = "refs/heads/side" &&
- (cat >expect.messages <<EOF
-M one
-EOF
-) &&
+ printf "M\t%s\n" one >expect.messages &&
test_cmp expect.messages messages &&
fill "M one" "A three" "D two" >expect.master &&
@@ -409,12 +402,12 @@ test_expect_success \
test_expect_success \
'checkout w/autosetupmerge=always sets up tracking' '
+ test_when_finished git config branch.autosetupmerge false &&
git config branch.autosetupmerge always &&
git checkout master &&
git checkout -b track2 &&
test "$(git config branch.track2.remote)" &&
- test "$(git config branch.track2.merge)"
- git config branch.autosetupmerge false'
+ test "$(git config branch.track2.merge)"'
test_expect_success 'checkout w/--track from non-branch HEAD fails' '
git checkout master^0 &&