Skip to content

Commit fe6c64a

Browse files
tgrennangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 661bfd1 commit fe6c64a

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

t/t5512-ls-remote.sh

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ test_description='git ls-remote'
55
. ./test-lib.sh
66

77
test_expect_success setup '
8-
98
>file &&
109
git add file &&
1110
test_tick &&
@@ -18,45 +17,33 @@ test_expect_success setup '
1817
) >expected.all &&
1918
2019
git remote add self "$(pwd)/.git"
21-
2220
'
2321

2422
test_expect_success 'ls-remote --tags .git' '
25-
2623
git ls-remote --tags .git >actual &&
2724
test_cmp expected.tag actual
28-
2925
'
3026

3127
test_expect_success 'ls-remote .git' '
32-
3328
git ls-remote .git >actual &&
3429
test_cmp expected.all actual
35-
3630
'
3731

3832
test_expect_success 'ls-remote --tags self' '
39-
4033
git ls-remote --tags self >actual &&
4134
test_cmp expected.tag actual
42-
4335
'
4436

4537
test_expect_success 'ls-remote self' '
46-
4738
git ls-remote self >actual &&
4839
test_cmp expected.all actual
49-
5040
'
5141

5242
test_expect_success 'dies when no remote specified and no default remotes found' '
53-
5443
test_must_fail git ls-remote
55-
5644
'
5745

5846
test_expect_success 'use "origin" when no remote specified' '
59-
6047
URL="$(pwd)/.git" &&
6148
echo "From $URL" >exp_err &&
6249
@@ -65,18 +52,14 @@ test_expect_success 'use "origin" when no remote specified' '
6552
6653
test_cmp exp_err actual_err &&
6754
test_cmp expected.all actual
68-
6955
'
7056

7157
test_expect_success 'suppress "From <url>" with -q' '
72-
7358
git ls-remote -q 2>actual_err &&
7459
test_must_fail test_cmp exp_err actual_err
75-
7660
'
7761

7862
test_expect_success 'use branch.<name>.remote if possible' '
79-
8063
#
8164
# Test that we are indeed using branch.<name>.remote, not "origin", even
8265
# though the "origin" remote has been set.
@@ -99,14 +82,13 @@ test_expect_success 'use branch.<name>.remote if possible' '
9982
git ls-remote 2>actual_err >actual &&
10083
test_cmp exp_err actual_err &&
10184
test_cmp exp actual
102-
10385
'
10486

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
10987
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
11092
#
11193
# Do not expect "git ls-remote <pattern>" to work; ls-remote, correctly,
11294
# 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' '
120102
# role as a pattern.
121103
test_must_fail git ls-remote refs*master >actual 2>&1 &&
122104
test_cmp exp actual
123-
124105
'
125106

126107
test_expect_success 'die with non-2 for wrong repository even with --exit-code' '

0 commit comments

Comments
 (0)