git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Charles Bailey <cbailey32@bloomberg.net>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] Don't rely on strerror text when testing rmdir failure
Date: Sat, 29 Mar 2014 16:48:44 +0100	[thread overview]
Message-ID: <5336EB5C.6040103@web.de> (raw)
In-Reply-To: <1396107541-22974-3-git-send-email-cbailey32@bloomberg.net>

Am 29.03.2014 16:39, schrieb Charles Bailey:
> AIX doesn't make a distiction between EEXIST and ENOTEMPTY so relying on
> the strerror string for the rmdir failure is fragile. Just test that the
> start of the string matches the Git controlled "failed to rmdir..."
> error. The exact text of the OS generated error string isn't important
> to the test.

Makes sense.

> Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
> ---
>  t/t3600-rm.sh | 5 ++---
>  t/t7001-mv.sh | 3 +--
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
> index 3d30581..23eed17 100755
> --- a/t/t3600-rm.sh
> +++ b/t/t3600-rm.sh
> @@ -709,10 +709,9 @@ test_expect_success 'checking out a commit after submodule removal needs manual
>  	git commit -m "submodule removal" submod &&
>  	git checkout HEAD^ &&
>  	git submodule update &&
> -	git checkout -q HEAD^ 2>actual &&
> +	git checkout -q HEAD^ 2>/dev/null &&

Isn't this unrelated to the strerror issue you are fixing here?
Why not just drop the redirection completely? But maybe I'm just
being to pedantic here ;-)

>  	git checkout -q master 2>actual &&
> -	echo "warning: unable to rmdir submod: Directory not empty" >expected &&
> -	test_i18ncmp expected actual &&
> +	test_i18ngrep "^warning: unable to rmdir submod:" actual &&
>  	git status -s submod >actual &&
>  	echo "?? submod/" >expected &&
>  	test_cmp expected actual &&
> diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
> index 215d43d..34fb1af 100755
> --- a/t/t7001-mv.sh
> +++ b/t/t7001-mv.sh
> @@ -447,8 +447,7 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
>  	git mv sub sub2 &&
>  	git commit -m "moved sub to sub2" &&
>  	git checkout -q HEAD^ 2>actual &&
> -	echo "warning: unable to rmdir sub2: Directory not empty" >expected &&
> -	test_i18ncmp expected actual &&
> +	test_i18ngrep "^warning: unable to rmdir sub2:" actual &&
>  	git status -s sub2 >actual &&
>  	echo "?? sub2/" >expected &&
>  	test_cmp expected actual &&
> 

  reply	other threads:[~2014-03-29 15:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-29 15:38 AIX fixes Charles Bailey
2014-03-29 15:39 ` [PATCH 1/2] Remove inline from git_fnmatch in dir.c Charles Bailey
2014-03-29 15:39 ` [PATCH 2/2] Don't rely on strerror text when testing rmdir failure Charles Bailey
2014-03-29 15:48   ` Jens Lehmann [this message]
2014-03-29 15:58     ` Charles Bailey
2014-03-31 17:35     ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=5336EB5C.6040103@web.de \
    --to=jens.lehmann@web.de \
    --cc=cbailey32@bloomberg.net \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).