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

Re: [PATCH] t7300: fix broken && chains

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 31, 2015, 16:58 UTC
Message-ID
<xmqqzj17wg1i.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1440926289-5899-1-git-send-email-erik.elfstrom@gmail.com>
Erik Elfström <erik.elfstrom@gmail.com> writes:
> While we are here, remove some boilerplate by using test_commit.
>
> Signed-off-by: Erik Elfström <erik.elfstrom@gmail.com>
> ---

Many of the constructs we see here shows clearly that this is an ancient part of the codebase ;-), as we would be using the one parameter form of "git init" and more test_* helpers if we were writing this script in today's Git codebase. It may have been better if you didn't do "while we are here" and corrected only the &&-chain in patch 1/2 and then updated the style of the tests to take advantage of the newer facilities recent test-lib has in a separate patch 2/2, but this will do at least for now.

Will queue.
Thanks.
Show 51 quoted lines
>  t/t7300-clean.sh | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
> index 27557d6..86ceb38 100755
> --- a/t/t7300-clean.sh
> +++ b/t/t7300-clean.sh
> @@ -432,9 +432,7 @@ test_expect_success 'nested git work tree' '
>  	(
>  		cd foo &&
>  		git init &&
> -		>hello.world
> -		git add . &&
> -		git commit -a -m nested
> +		test_commit nested hello.world
>  	) &&
>  	(
>  		cd bar &&
> @@ -443,9 +441,7 @@ test_expect_success 'nested git work tree' '
>  	(
>  		cd baz/boo &&
>  		git init &&
> -		>deeper.world
> -		git add . &&
> -		git commit -a -m deeply.nested
> +		test_commit deeply.nested deeper.world
>  	) &&
>  	git clean -f -d &&
>  	test -f foo/.git/index &&
> @@ -601,9 +597,7 @@ test_expect_success 'force removal of nested git work tree' '
>  	(
>  		cd foo &&
>  		git init &&
> -		>hello.world
> -		git add . &&
> -		git commit -a -m nested
> +		test_commit nested hello.world
>  	) &&
>  	(
>  		cd bar &&
> @@ -612,9 +606,7 @@ test_expect_success 'force removal of nested git work tree' '
>  	(
>  		cd baz/boo &&
>  		git init &&
> -		>deeper.world
> -		git add . &&
> -		git commit -a -m deeply.nested
> +		test_commit deeply.nested deeper.world
>  	) &&
>  	git clean -f -f -d &&
>  	! test -d foo &&
Previous: Erik ElfströmNext: erik elfström
Message 2 of 7 in “t7300: fix broken && chains”
  1. t7300: fix broken && chainsErik Elfström, Aug 30, 2015
  2. Junio C HamanoAug 31, 2015
  3. erik elfströmSep 1, 2015
  4. Junio C HamanoSep 1, 2015
  5. Jeff KingAug 31, 2015
  6. erik elfströmSep 1, 2015
  7. Jeff KingSep 1, 2015

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.