git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] t3005: do not assume a particular order of stdout and stderr of git-ls-files
Date: Sun, 28 Aug 2011 09:34:56 +0200	[thread overview]
Message-ID: <4E59EFA0.7020209@kdbg.org> (raw)

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>
---
 t/t3005-ls-files-relative.sh |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
index a2b63e2..3778694 100755
--- a/t/t3005-ls-files-relative.sh
+++ b/t/t3005-ls-files-relative.sh
@@ -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
 	)
 '
 
-- 
1.7.7.rc0.92.g0cd2b

                 reply	other threads:[~2011-08-28  7:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E59EFA0.7020209@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).