Re: [PATCH 1/3] Use startup_info->prefix rather than prefix.

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

 



2012/3/3 Junio C Hamano <gitster@xxxxxxxxx>:
> Jared Hance <jaredhance@xxxxxxxxx> writes:
>
>> In trace_repo_setup, prefix is passed in as startup_info->prefix. But, as
>> indicated but a FIXME comment, trace_repo_setup has access to
>> startup_info. The prefix parameter has therefor been eliminated.
>>
>> Signed-off-by: Jared Hance <jaredhance@xxxxxxxxx>
>> ---
>
> This comes from a9ca8a8 (builtins: print setup info if repo is found,
> 2010-11-26) and hasn't ever changed over time, even across f07d6a1 (setup:
> save prefix (original cwd relative to toplevel) in startup_info,
> 2010-12-01) that did add the necessary "prefix" field to the startup_info
> and was done reasonably close to the patch that wanted to have the field
> in the first place.
>
> The fix looks too easy to be correct X-<; in other words, I find it hard
> to believe that such a triviality was left without a good reason, but I do
> not think of any.
>
> Well, but perhaps something too good to be true is indeed true sometimes.

This patch makes this function only usable when startup_info pointer
is initialized. As "git" binary is the only caller, the change is ok.
If non-builtin commands want to use this function, they need to
initialize startup_info first.
-- 
Duy
--
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]