git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Vajna <vmiklos@frugalware.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Olivier Marin <dkr@freesurf.fr>,
	git@vger.kernel.org, Mike Ralphson <mike@abacus.co.uk>
Subject: [RFC/PATCH] Fix t7601-merge-pull-config.sh on AIX
Date: Sat,  5 Jul 2008 16:23:58 +0200	[thread overview]
Message-ID: <1215267838-19402-1-git-send-email-vmiklos@frugalware.org> (raw)

The test failed on AIX (and likely other OS, such as apparently OSX)
where wc -l outputs whitespace.

Also, avoid unnecessary eval in conflict_count().

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

On Fri, Jul 04, 2008 at 06:49:03PM -0700, Junio C Hamano <gitster@pobox.com> wrote:
> In any case, this feels like an unnecessary use of eval.  The call
> site
> you have look like this:
>
>       conflict_count resolve_count
>
> but it is more natural if you are programming in shell to call it
> like:
>
>       resolve_count=$(count_conflicts)

Changed.

> If you are going to do numerical comparison in later versions, you can
> just drop the dq around parameters of test:
>
>       test $count_three = $count_two

Changed.

Mike, could you please confirm that this solves your problem as well?

 t/t7601-merge-pull-config.sh |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh
index 32585f8..95b4d71 100755
--- a/t/t7601-merge-pull-config.sh
+++ b/t/t7601-merge-pull-config.sh
@@ -70,10 +70,10 @@ test_expect_success 'merge c1 with c2 and c3 (recursive and octopus in pull.octo
 
 conflict_count()
 {
-	eval $1=`{
+	{
 		git diff-files --name-only
 		git ls-files --unmerged
-	} | wc -l`
+	} | wc -l
 }
 
 # c4 - c5
@@ -115,15 +115,15 @@ test_expect_success 'merge picks up the best result' '
 	git config pull.twohead "recursive resolve" &&
 	git reset --hard c5 &&
 	git merge -s resolve c6
-	conflict_count resolve_count &&
+	resolve_count=$(conflict_count) &&
 	git reset --hard c5 &&
 	git merge -s recursive c6
-	conflict_count recursive_count &&
+	recursive_count=$(conflict_count) &&
 	git reset --hard c5 &&
 	git merge c6
-	conflict_count auto_count &&
-	test "$auto_count" = "$recursive_count" &&
-	test "$auto_count" != "$resolve_count"
+	auto_count=$(conflict_count) &&
+	test $auto_count = $recursive_count &&
+	test $auto_count != $resolve_count
 '
 
 test_done
-- 
1.5.6.1.322.ge904b.dirty

             reply	other threads:[~2008-07-05 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-05 14:23 Miklos Vajna [this message]
2008-07-06  8:15 ` [RFC/PATCH] Fix t7601-merge-pull-config.sh on AIX Brian Gernhardt

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=1215267838-19402-1-git-send-email-vmiklos@frugalware.org \
    --to=vmiklos@frugalware.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dkr@freesurf.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mike@abacus.co.uk \
    /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).