@@ -5,7 +5,6 @@ test_description='git ls-remote'
5
5
. ./test-lib.sh
6
6
7
7
test_expect_success setup '
8
-
9
8
>file &&
10
9
git add file &&
11
10
test_tick &&
@@ -18,45 +17,33 @@ test_expect_success setup '
18
17
) >expected.all &&
19
18
20
19
git remote add self "$(pwd)/.git"
21
-
22
20
'
23
21
24
22
test_expect_success ' ls-remote --tags .git' '
25
-
26
23
git ls-remote --tags .git >actual &&
27
24
test_cmp expected.tag actual
28
-
29
25
'
30
26
31
27
test_expect_success ' ls-remote .git' '
32
-
33
28
git ls-remote .git >actual &&
34
29
test_cmp expected.all actual
35
-
36
30
'
37
31
38
32
test_expect_success ' ls-remote --tags self' '
39
-
40
33
git ls-remote --tags self >actual &&
41
34
test_cmp expected.tag actual
42
-
43
35
'
44
36
45
37
test_expect_success ' ls-remote self' '
46
-
47
38
git ls-remote self >actual &&
48
39
test_cmp expected.all actual
49
-
50
40
'
51
41
52
42
test_expect_success ' dies when no remote specified and no default remotes found' '
53
-
54
43
test_must_fail git ls-remote
55
-
56
44
'
57
45
58
46
test_expect_success ' use "origin" when no remote specified' '
59
-
60
47
URL="$(pwd)/.git" &&
61
48
echo "From $URL" >exp_err &&
62
49
@@ -65,18 +52,14 @@ test_expect_success 'use "origin" when no remote specified' '
65
52
66
53
test_cmp exp_err actual_err &&
67
54
test_cmp expected.all actual
68
-
69
55
'
70
56
71
57
test_expect_success ' suppress "From <url>" with -q' '
72
-
73
58
git ls-remote -q 2>actual_err &&
74
59
test_must_fail test_cmp exp_err actual_err
75
-
76
60
'
77
61
78
62
test_expect_success ' use branch.<name>.remote if possible' '
79
-
80
63
#
81
64
# Test that we are indeed using branch.<name>.remote, not "origin", even
82
65
# though the "origin" remote has been set.
@@ -99,14 +82,13 @@ test_expect_success 'use branch.<name>.remote if possible' '
99
82
git ls-remote 2>actual_err >actual &&
100
83
test_cmp exp_err actual_err &&
101
84
test_cmp exp actual
102
-
103
85
'
104
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
109
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
110
92
#
111
93
# Do not expect "git ls-remote <pattern>" to work; ls-remote, correctly,
112
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' '
120
102
# role as a pattern.
121
103
test_must_fail git ls-remote refs*master >actual 2>&1 &&
122
104
test_cmp exp actual
123
-
124
105
'
125
106
126
107
test_expect_success ' die with non-2 for wrong repository even with --exit-code' '
0 commit comments