Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 15, 2017, 23:23 UTC
- Message-ID
- <xmqqh8x8pg8p.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170815224332.22730-1-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 15 quoted lines
> "git push --recurse-submodules=on-demand" adds each submodule as an > alternate with add_submodule_odb before checking whether the > submodule has anything to push and pushing it if so. > > However, it never accesses any objects from the submodule. > ... > Use is_submodule_populated_gently instead, which is simpler and > cheaper. > > Signed-off-by: Stefan Beller <sbeller@google.com> > --- > > Originally I intended to send this out as part of a larger series, > but the series is getting too large series, sending all things in smaller > units!
This vaguely reminds me that you sent something imilar perhaps for a different codepath.
Is "is it populated" a good thing to check here, though? IIRC, add-submodule-odb allows you to add the object database of an inactivated submodule, so this seems to change the behaviour. I do not know if the behaviour change is a good thing (i.e. bugfix) or not (i.e. regression) offhand, though.
Thanks.
Show 15 quoted lines
> diff --git a/submodule.c b/submodule.c
> index 111a3007fc..e20216bc0f 100644
> --- a/submodule.c
> +++ b/submodule.c
> @@ -966,7 +966,9 @@ static int push_submodule(const char *path,
> const struct string_list *push_options,
> int dry_run)
> {
> - if (add_submodule_odb(path))
> + int code;
> +
> + if (!is_submodule_populated_gently(path, &code))
> return 1;
>
> if (for_each_remote_ref_submodule(path, has_remote, NULL) > 0) {