Subject: Re: [PATCH 11/16] test-lib: do not show advice about init.defaultBranch under --verbose

From: SZEDER Gábor <[email-masked]>
Date: Thu, 15 Apr 2021 21:07:51 +0200

On Mon, Apr 12, 2021 at 01:09:00PM +0200, Ævar Arnfjörð Bjarmason wrote:
> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
> index 674b865a20d..c81726acb9e 100644
> --- a/t/test-lib-functions.sh
> +++ b/t/test-lib-functions.sh
> @@ -1259,7 +1259,6 @@ test_create_repo () {
>  	(
>  		cd "$repo" || error "Cannot setup test environment"
>  		"${GIT_TEST_INSTALLED:-$GIT_EXEC_PATH}/git$X" \
> -			-c init.defaultBranch="${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}" \
>  			init \

This change got my hopes up that

  GIT_TEST_INSTALLED=/.../v1.6.0/bin ./t9999-foo.sh

will work again (it didn't yet support 'git init -c <...>'), but,
alas, already the next patch will turn this into 'git init ...
<trash-dir>', and v1.6.0 didn't support that, either, so it will
remain broken...  Oh, well.

>  			"--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 ||
>  		error "cannot run git init -- have you built things yet?"
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index a8869eee58f..0057dfa69d0 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -64,6 +64,11 @@ then
>  	export GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS
>  fi
>  
> +# Explicitly set the default branch name for testing, to avoid the
> +# transitory "git init" warning under --verbose.
> +: ${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME:=master}
> +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> +
>  ################################################################
>  # It appears that people try to run tests without building...
>  "${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X" >/dev/null
> -- 
> 2.31.1.634.gb41287a30b0
>