Re: [PATCH] fetch: allow adding a filter after initial clone.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xin Li <delphij@xxxxxxxxxx> writes:

(nothnig).

Can you help readers by describing what this change is about?

This space is reserved for the patch author to describe why this
change is a good idea (if this patch is adding a new feature), what
is already broken without this patch (if this patch is a bugfix),
and why this change is a safe thing to do (if this patch lifts a
limitation we had before that has been protecting us from getting
into a bad state).


> Signed-off-by: Xin Li <delphij@xxxxxxxxxx>
> ---
>  builtin/fetch.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 3ae52c015d..e5faa17ecd 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -1790,8 +1790,16 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
>  	if (depth || deepen_since || deepen_not.nr)
>  		deepen = 1;
>  
> -	if (filter_options.choice && !has_promisor_remote())
> -		die("--filter can only be used when extensions.partialClone is set");
> +	if (filter_options.choice && !has_promisor_remote()) {
> +		char repo_version_string[10];
> +
> +		xsnprintf(repo_version_string, sizeof(repo_version_string),
> +			  "%d", (int)GIT_REPO_VERSION);
> +		git_config_set("core.repositoryformatversion",
> +			repo_version_string);
> +		git_config_set("extensions.partialclone", "origin");
> +		promisor_remote_reinit();
> +	}
>  
>  	if (all) {
>  		if (argc == 1)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux