Skip to content

Commit d92a015

Browse files
committed
Merge branch 'rj/test-i18ngrep'
Test updates. * rj/test-i18ngrep: t5536: simplify checking of messages output to stderr t4151: consolidate multiple calls to test_i18ngrep
2 parents 787aa97 + 51b74b5 commit d92a015

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

t/t4151-am-abort.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ do
4646

4747
test_expect_success "am$with3 --skip continue after failed am$with3" '
4848
test_must_fail git am$with3 --skip >output &&
49-
test_i18ngrep "^Applying" output >output.applying &&
50-
test_i18ngrep "^Applying: 6$" output.applying &&
51-
test_i18ncmp file-2-expect file-2 &&
49+
test_i18ngrep "^Applying: 6$" output &&
50+
test_cmp file-2-expect file-2 &&
5251
test ! -f .git/MERGE_RR
5352
'
5453

t/t5536-fetch-conflicts.sh

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ setup_repository () {
1818
)
1919
}
2020

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-
2921
test_expect_success 'setup' '
3022
git commit --allow-empty -m "Initial" &&
3123
git branch branch1 &&
@@ -48,9 +40,7 @@ test_expect_success 'fetch conflict: config vs. config' '
4840
"+refs/heads/branch2:refs/remotes/origin/branch1" && (
4941
cd ccc &&
5042
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
5444
)
5545
'
5646

@@ -77,9 +67,7 @@ test_expect_success 'fetch conflict: arg vs. arg' '
7767
test_must_fail git fetch origin \
7868
refs/heads/*:refs/remotes/origin/* \
7969
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
8371
)
8472
'
8573

@@ -90,10 +78,8 @@ test_expect_success 'fetch conflict: criss-cross args' '
9078
git fetch origin \
9179
refs/heads/branch1:refs/remotes/origin/branch2 \
9280
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
9783
)
9884
'
9985

0 commit comments

Comments
 (0)