@@ -18,14 +18,6 @@ setup_repository () {
18
18
)
19
19
}
20
20
21
- verify_stderr () {
22
- cat > expected &&
23
- # We're not interested in the error
24
- # "fatal: The remote end hung up unexpectedly":
25
- test_i18ngrep -E ' ^(fatal|warning):' error | grep -v ' hung up' > actual | sort &&
26
- test_i18ncmp expected actual
27
- }
28
-
29
21
test_expect_success ' setup' '
30
22
git commit --allow-empty -m "Initial" &&
31
23
git branch branch1 &&
@@ -48,9 +40,7 @@ test_expect_success 'fetch conflict: config vs. config' '
48
40
"+refs/heads/branch2:refs/remotes/origin/branch1" && (
49
41
cd ccc &&
50
42
test_must_fail git fetch origin 2>error &&
51
- verify_stderr <<-\EOF
52
- fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1
53
- EOF
43
+ test_i18ngrep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
54
44
)
55
45
'
56
46
@@ -77,9 +67,7 @@ test_expect_success 'fetch conflict: arg vs. arg' '
77
67
test_must_fail git fetch origin \
78
68
refs/heads/*:refs/remotes/origin/* \
79
69
refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
80
- verify_stderr <<-\EOF
81
- fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1
82
- EOF
70
+ test_i18ngrep "fatal: Cannot fetch both refs/heads/branch1 and refs/heads/branch2 to refs/remotes/origin/branch1" error
83
71
)
84
72
'
85
73
@@ -90,10 +78,8 @@ test_expect_success 'fetch conflict: criss-cross args' '
90
78
git fetch origin \
91
79
refs/heads/branch1:refs/remotes/origin/branch2 \
92
80
refs/heads/branch2:refs/remotes/origin/branch1 2>error &&
93
- verify_stderr <<-\EOF
94
- warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2
95
- warning: refs/remotes/origin/branch2 usually tracks refs/heads/branch2, not refs/heads/branch1
96
- EOF
81
+ test_i18ngrep "warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2" error &&
82
+ test_i18ngrep "warning: refs/remotes/origin/branch2 usually tracks refs/heads/branch2, not refs/heads/branch1" error
97
83
)
98
84
'
99
85
0 commit comments