From: Glen Choo Date: Wed, 16 Feb 2022 07:08:44 GMT Subject: Re: [PATCH v2 3/9] submodule: make static functions read submodules from commits Message-ID: In-Reply-To: <220215.86mtirwzzo.gmgdl@evledraar.gmail.com> Ævar Arnfjörð Bjarmason writes: > 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 > }; Since I'm touching the line anyway, this seems like a reasonable change.