Re: [PATCH 2/2] clone: Allow repo using gitfile as a reference
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 8, 2013, 18:00 UTC
- Message-ID
- <7vehekykan.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130408000845.GH27178@pug.qqx.org>
[ADMINISTRIVIA: please do not redirect a direct reply to you to other people using Mail-Followup-To.]
Aaron Schrab <aaron@schrab.com> writes:
Show 12 quoted lines
> At 16:51 -0700 07 Apr 2013, Jonathan Nieder <jrnieder@gmail.com> wrote:
>>> - 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.
>
> Good catch. I'll fix that in the next version.Thanks. The patch otherwise looks good to me.