t5512 (ls-remote): modernize style

Prepare expected output inside test_expect_success that uses it. Also remove excess blank lines. Signed-off-by: Tom Grennan <tmgrennan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tom Grennan committed Mar 2, 2012 at 18:15 UTC fe6c64ab0b2b568755a6686c0a435fa95ef619bb
1 file changed +4 -23
t/t5512-ls-remote.sh
+4 -23
@@ -5,7 +5,6 @@ test_description='git ls-remote'
5 . ./test-lib.sh
6
7 test_expect_success setup '
8 -
8 >file &&
9 git add file &&
10 test_tick &&
@@ -18,45 +17,33 @@ test_expect_success setup '
17 ) >expected.all &&
18
19 git remote add self "$(pwd)/.git"
21 -
20 '
21
22 test_expect_success 'ls-remote --tags .git' '
25 -
23 git ls-remote --tags .git >actual &&
24 test_cmp expected.tag actual
28 -
25 '
26
27 test_expect_success 'ls-remote .git' '
32 -
28 git ls-remote .git >actual &&
29 test_cmp expected.all actual
35 -
30 '
31
32 test_expect_success 'ls-remote --tags self' '
39 -
33 git ls-remote --tags self >actual &&
34 test_cmp expected.tag actual
42 -
35 '
36
37 test_expect_success 'ls-remote self' '
46 -
38 git ls-remote self >actual &&
39 test_cmp expected.all actual
49 -
40 '
41
42 test_expect_success 'dies when no remote specified and no default remotes found' '
53 -
43 test_must_fail git ls-remote
55 -
44 '
45
46 test_expect_success 'use "origin" when no remote specified' '
59 -
47 URL="$(pwd)/.git" &&
48 echo "From $URL" >exp_err &&
49
@@ -65,18 +52,14 @@ test_expect_success 'use "origin" when no remote specified' '
52
53 test_cmp exp_err actual_err &&
54 test_cmp expected.all actual
68 -
55 '
56
57 test_expect_success 'suppress "From <url>" with -q' '
72 -
58 git ls-remote -q 2>actual_err &&
59 test_must_fail test_cmp exp_err actual_err
75 -
60 '
61
62 test_expect_success 'use branch.<name>.remote if possible' '
79 -
63 #
64 # Test that we are indeed using branch.<name>.remote, not "origin", even
65 # though the "origin" remote has been set.
@@ -99,14 +82,13 @@ test_expect_success 'use branch.<name>.remote if possible' '
82 git ls-remote 2>actual_err >actual &&
83 test_cmp exp_err actual_err &&
84 test_cmp exp actual
102 -
85 '
86
105 -cat >exp <<EOF
106 -fatal: 'refs*master' does not appear to be a git repository
107 -fatal: The remote end hung up unexpectedly
108 -EOF
87 test_expect_success 'confuses pattern as remote when no remote specified' '
88 + cat >exp <<-\EOF &&
89 + fatal: '\''refs*master'\'' does not appear to be a git repository
90 + fatal: The remote end hung up unexpectedly
91 + EOF
92 #
93 # Do not expect "git ls-remote <pattern>" to work; ls-remote, correctly,
94 # confuses <pattern> for <remote>. Although ugly, this behaviour is akin
@@ -120,7 +102,6 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
102 # role as a pattern.
103 test_must_fail git ls-remote refs*master >actual 2>&1 &&
104 test_cmp exp actual
123 -
105 '
106
107 test_expect_success 'die with non-2 for wrong repository even with --exit-code' '