Skip to content

Commit b00b6ac

Browse files
matvoregitster
authored andcommitted
t9109: don't swallow Git errors upstream of pipes
'git ... | foo' will mask any errors or crashes in git, so split up such pipes in this file. One testcase uses several separate pipe sequences in a row which are awkward to split up. Wrap the split-up pipe in a function so the awkwardness is not repeated. Also change that testcase's surrounding quotes from double to single to avoid premature string interpolation. Signed-off-by: Matthew DeVore <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 61de0ff commit b00b6ac

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

t/t9101-git-svn-props.sh

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ test_expect_success 'test create-ignore' "
174174
cmp ./deeply/.gitignore create-ignore.expect &&
175175
cmp ./deeply/nested/.gitignore create-ignore.expect &&
176176
cmp ./deeply/nested/directory/.gitignore create-ignore.expect &&
177-
git ls-files -s | grep gitignore | cmp - create-ignore-index.expect
177+
git ls-files -s >ls_files_result &&
178+
grep gitignore ls_files_result | cmp - create-ignore-index.expect
178179
"
179180

180181
cat >prop.expect <<\EOF
@@ -189,17 +190,21 @@ EOF
189190
# This test can be improved: since all the svn:ignore contain the same
190191
# pattern, it can pass even though the propget did not execute on the
191192
# right directory.
192-
test_expect_success 'test propget' "
193-
git svn propget svn:ignore . | cmp - prop.expect &&
193+
test_expect_success 'test propget' '
194+
test_propget () {
195+
git svn propget $1 $2 >actual &&
196+
cmp $3 actual
197+
} &&
198+
test_propget svn:ignore . prop.expect &&
194199
cd deeply &&
195-
git svn propget svn:ignore . | cmp - ../prop.expect &&
196-
git svn propget svn:entry:committed-rev nested/directory/.keep \
197-
| cmp - ../prop2.expect &&
198-
git svn propget svn:ignore .. | cmp - ../prop.expect &&
199-
git svn propget svn:ignore nested/ | cmp - ../prop.expect &&
200-
git svn propget svn:ignore ./nested | cmp - ../prop.expect &&
201-
git svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect
202-
"
200+
test_propget svn:ignore . ../prop.expect &&
201+
test_propget svn:entry:committed-rev nested/directory/.keep \
202+
../prop2.expect &&
203+
test_propget svn:ignore .. ../prop.expect &&
204+
test_propget svn:ignore nested/ ../prop.expect &&
205+
test_propget svn:ignore ./nested ../prop.expect &&
206+
test_propget svn:ignore .././deeply/nested ../prop.expect
207+
'
203208

204209
cat >prop.expect <<\EOF
205210
Properties on '.':
@@ -218,8 +223,11 @@ Properties on 'nested/directory/.keep':
218223
EOF
219224

220225
test_expect_success 'test proplist' "
221-
git svn proplist . | cmp - prop.expect &&
222-
git svn proplist nested/directory/.keep | cmp - prop2.expect
226+
git svn proplist . >actual &&
227+
cmp prop.expect actual &&
228+
229+
git svn proplist nested/directory/.keep >actual &&
230+
cmp prop2.expect actual
223231
"
224232

225233
test_done

0 commit comments

Comments
 (0)