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

RE: [PATCH 2/2] t: use test_config whenever possible

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 15, 2021, 20:15 UTC
Message-ID
<60a02bf2f16a2_eacf52085@natae.notmuch>
In-Reply-To
<20210514065508.247044-2-firminmartin24@gmail.com>
Firmin Martin wrote:
Show 17 quoted lines
> diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
> index ed11569d8d..ff18263171 100755
> --- a/t/t5526-fetch-submodules.sh
> +++ b/t/t5526-fetch-submodules.sh
> @@ -418,7 +418,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config
>  		git fetch --recurse-submodules
>  	) &&
>  	add_upstream_commit &&
> -	git config --global fetch.recurseSubmodules false &&
> +	test_config_global fetch.recurseSubmodules false &&
>  	head1=$(git rev-parse --short HEAD) &&
>  	git add submodule &&
>  	git commit -m "new submodule" &&
> @@ -429,11 +429,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config
>  	(
>  		cd downstream &&
>  		git config fetch.recurseSubmodules on-demand &&
Uhm:
  test_config fetch.recurseSubmodules on-demand &&
Show 7 quoted lines
> -		git fetch >../actual.out 2>../actual.err
> -	) &&
> -	git config --global --unset fetch.recurseSubmodules &&
> -	(
> -		cd downstream &&
> +		git fetch >../actual.out 2>../actual.err &&
>  		git config --unset fetch.recurseSubmodules
Then the above line can be removed too.
Show 15 quoted lines
>  	) &&
>  	test_must_be_empty actual.out &&
> @@ -446,7 +442,7 @@ test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' override
>  		git fetch --recurse-submodules
>  	) &&
>  	add_upstream_commit &&
> -	git config fetch.recurseSubmodules false &&
> +	test_config fetch.recurseSubmodules false &&
>  	head1=$(git rev-parse --short HEAD) &&
>  	git add submodule &&
>  	git commit -m "new submodule" &&
> @@ -457,11 +453,7 @@ test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' override
>  	(
>  		cd downstream &&
>  		git config submodule.submodule.fetchRecurseSubmodules on-demand &&
Ditto.
Very nice cleanup.
-- 
Felipe Contreras
Previous: Firmin MartinNext: Felipe Contreras
Message 3 of 15 in “t/README: document test_config”
  1. 1/2 t/README: document test_configFirmin Martin, May 14, 2021
  2. 2/2 t: use test_config whenever possibleFirmin Martin, May 14, 2021
  3. Felipe ContrerasMay 15, 2021
  4. Felipe ContrerasMay 15, 2021
  5. Firmin MartinMay 15, 2021
  6. Eric SunshineMay 14, 2021
  7. Firmin MartinMay 15, 2021
  8. 0/2 document test_config & use it whenever possibleFirmin Martin, May 15, 2021
  9. 1/2 t/README: document test_configFirmin Martin, May 15, 2021
  10. Bagas SanjayaMay 16, 2021
  11. Firmin MartinMay 17, 2021
  12. 2/2 t: use test_config whenever possibleFirmin Martin, May 15, 2021
  13. Junio C HamanoMay 16, 2021
  14. Firmin MartinMay 17, 2021
  15. Junio C HamanoMay 17, 2021

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.