Re: [PATCH 2/2] clone: Allow repo using gitfile as a reference

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

 



Aaron Schrab wrote:

> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -232,11 +232,19 @@ static void strip_trailing_slashes(char *dir)
>  static int add_one_reference(struct string_list_item *item, void *cb_data)
>  {
>  	char *ref_git;
> +	const char *repo;
>  	struct strbuf alternate = STRBUF_INIT;
>  
> -	/* Beware: real_path() and mkpath() return static buffer */
> +	/* Beware: read_gitfile(), real_path() and mkpath() return static buffer */
>  	ref_git = xstrdup(real_path(item->string));
> -	if (is_directory(mkpath("%s/.git/objects", ref_git))) {
> +
> +	repo = read_gitfile(mkpath("%s/.git", ref_git));
[...]
> +++ b/t/t5700-clone-reference.sh
> @@ -185,4 +185,11 @@ test_expect_success 'fetch with incomplete alternates' '
>  	! grep " want $tag_object" "$U.K"
>  '
>  
> +test_expect_success 'clone using repo with gitfile as a reference' '
> +	git clone --separate-git-dir=L A M &&
> +	git clone --reference=M A N &&

What should happen if I pass --reference=M/.git?

> +	echo "$base_dir/L/objects" > expected &&

The usual style in tests is to include no space after >redirection
operators.

With those two changes,
Reviewed-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]