Re: [PATCH v3 05/11] promisor-remote: use repository_format_partial_clone
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 13, 2019, 04:31 UTC
- Message-ID
- <xmqqftrre6p1.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190312132959.11764-6-chriscool@tuxfamily.org>
Christian Couder <christian.couder@gmail.com> writes:
Show 6 quoted lines
> A remote specified using the extensions.partialClone config > option should be considered a promisor remote too. > > This remote should be at the end of the promisor remote list, > so that it is used only if objects have not been found in other > remotes.
That's a declaration, not a rationale, and does not answer "Why should the origin be only used as the last resort?".
Show 27 quoted lines
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
> promisor-remote.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/promisor-remote.c b/promisor-remote.c
> index ea74f6d8a8..dcf6ef6521 100644
> --- a/promisor-remote.c
> +++ b/promisor-remote.c
> @@ -83,6 +83,17 @@ static void promisor_remote_do_init(int force)
> initialized = 1;
>
> git_config(promisor_remote_config, NULL);
> +
> + if (repository_format_partial_clone) {
> + struct promisor_remote *o, *previous;
> +
> + o = promisor_remote_look_up(repository_format_partial_clone,
> + &previous);
> + if (o)
> + promisor_remote_move_to_tail(o, previous);
> + else
> + promisor_remote_new(repository_format_partial_clone);
> + }
> }
>
> static inline void promisor_remote_init(void)