Subject: Re: [PATCH v2 3/9] submodule: make static functions read submodules from commits

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Tue, 15 Feb 2022 23:00:24 +0100

On Wed, Feb 16 2022, Glen Choo wrote:

> diff --git a/submodule.c b/submodule.c
> index 5ace18a7d9..7032dcabb8 100644
> --- a/submodule.c
> +++ b/submodule.c
> @@ -932,6 +932,7 @@ struct has_commit_data {
>  	struct repository *repo;
>  	int result;
>  	const char *path;
> +	const struct object_id *super_oid;
>  };

...

> -	struct has_commit_data has_commit = { r, 1, path };
> +	struct has_commit_data has_commit = { r, 1, path, super_oid };

FWIW I wouldn't at all mind the tiny detour of just turning this into
designated initializers while we're at it, instead of having to keep
track of the positionals. I.e.:

	[...] = {
		.repo = r,
		.result = 1,
                .path = path,
                ,super_oid = super_oid
	};