git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] Don't rely on strerror text when testing rmdir failure

From
Jens Lehmann <jens.lehmann@web.de>
Date
Mar 29, 2014, 15:48 UTC
Message-ID
<5336EB5C.6040103@web.de>
In-Reply-To
<1396107541-22974-3-git-send-email-cbailey32@bloomberg.net>
Am 29.03.2014 16:39, schrieb Charles Bailey:
Show 5 quoted lines
> 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.
Show 16 quoted lines
> 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 ;-)

Show 22 quoted lines
>  	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 &&
> 
Previous: Charles BaileyNext: Charles Bailey
Message 4 of 6 in “AIX fixes”
  1. Charles BaileyMar 29, 2014
  2. 1/2 Remove inline from git_fnmatch in dir.cCharles Bailey, Mar 29, 2014
  3. 2/2 Don't rely on strerror text when testing rmdir failureCharles Bailey, Mar 29, 2014
  4. Jens LehmannMar 29, 2014
  5. Charles BaileyMar 29, 2014
  6. Junio C HamanoMar 31, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.