1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-03 09:56:15 +02:00

t3005: do not assume a particular order of stdout and stderr of git-ls-files

There is no guarantee that stderr is flushed before stdout when both
channels are redirected to a file. Check the channels using independent
files.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Sixt 2011-08-28 09:34:56 +02:00 committed by Junio C Hamano
parent 0f64bfa956
commit 385ceec1cb

View File

@ -45,11 +45,12 @@ test_expect_success 'ls-files -c' '
for f in ../y*
do
echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
done >expect &&
echo "Did you forget to ${sq}git add${sq}?" >>expect &&
ls ../x* >>expect &&
test_must_fail git ls-files -c --error-unmatch ../[xy]* >actual 2>&1 &&
test_cmp expect actual
done >expect.err &&
echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
ls ../x* >expect.out &&
test_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&
test_cmp expect.out actual.out &&
test_cmp expect.err actual.err
)
'
@ -59,11 +60,12 @@ test_expect_success 'ls-files -o' '
for f in ../x*
do
echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
done >expect &&
echo "Did you forget to ${sq}git add${sq}?" >>expect &&
ls ../y* >>expect &&
test_must_fail git ls-files -o --error-unmatch ../[xy]* >actual 2>&1 &&
test_cmp expect actual
done >expect.err &&
echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
ls ../y* >expect.out &&
test_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&
test_cmp expect.out actual.out &&
test_cmp expect.err actual.err
)
'