Subject: Re: [PATCH v3] submodule: fetch missing objects from default remote

From: Junio C Hamano <[email-masked]>
Date: Fri, 23 Jan 2026 15:26:59 -0800

Nasser Grainawi <[email-masked]> writes:

> diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
> index 45f384dd32..faafe31409 100755
> --- a/t/t5572-pull-submodule.sh
> +++ b/t/t5572-pull-submodule.sh
> @@ -257,7 +257,26 @@ test_expect_success 'fetch submodule remote of different name from superproject'
>  	git -C a-submodule reset --hard HEAD^^ &&
>  
>  	git -C child pull --no-recurse-submodules &&
> -	git -C child submodule update
> +	git -C child submodule update &&
> +	test_path_is_file child/a-submodule/moreecho.t
> +'
> +
> +test_expect_success 'fetch submodule remote of different non-origin name from superproject' '
> +	git -C child/a-submodule remote rename origin o2 &&
> +
> +	# Create commit that is unreachable from current master branch
> +	git -C a-submodule checkout -b newmain2 master^ &&

This test assumes that the first branch created by default is
'master', which will break in one of the CI jobs:

  https://github.com/git/git/actions/runs/21304166518/job/61328461844#step:9:1942

If we are assuming that we are on the default branch when this
"Create commit" step runs, perhaps you can replace your "master^"
with "HEAD^" to achieve the same effect in a way that works
regardless of what the default branch is called?