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
> @@ -231,12 +231,19 @@ static void strip_trailing_slashes(char *dir)
>  
>  static int add_one_reference(struct string_list_item *item, void *cb_data)
>  {
> -	char *ref_git;
> +	char *ref_git, *repo;
[...]
> +	repo = (char *)read_gitfile(mkpath("%s/.git", ref_git));

Why not make repo a "const char *" and avoid the cast?  The above
would seem to make it too tempting to treat the return value from
read_gitfile() as a mutable buffer instead of a real_path string that
should be copied asap.

Hope that helps,
Jonathan
--
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]