Re: [PATCH 4/8] builtin/clone: move setup of alternates for shared local clones

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




Patrick Steinhardt <ps@xxxxxx> writes:
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 8eae3ac7d9..08c8f5a94f 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -220,7 +220,8 @@ static void copy_alternates(struct strbuf *src, const char *src_repo)
> 	fclose(in);
> }
>
> -static void collect_alternates(struct strvec *alternates)
> +static void collect_alternates(struct strvec *alternates,
> +			 const char *src_repo, bool is_local)
> {
> 	if (option_required_reference.nr || option_optional_reference.nr) {
> 		struct add_one_alternate_data data = {
> @@ -234,6 +235,16 @@ static void collect_alternates(struct strvec *alternates)
> 		for_each_string_list(&option_optional_reference,
> 				 add_one_alternate, &data);
> 	}
> +
> +	if (is_local) {
> +		struct strbuf commondir = STRBUF_INIT;
> +
> +		get_common_dir(&commondir, src_repo);
> +		if (option_shared)
> +			strvec_pushf(alternates, "%s/objects", commondir.buf);
Also the use of `commondir` seems to be only used if option_shared is
set, but it will be used in an else in a subsequential commit.
> +
> +		strbuf_release(&commondir);
> +	}
> }
-- 
Laters,
Toon

[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

AltStyle によって変換されたページ (->オリジナル) /