Re: [PATCH v3 1/1] trace.c, git.c: remove unnecessary parameter to trace_repo_setup()

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

 



Idriss Fekir <mcsm224@xxxxxxxxx> writes:

> From: idriss fekir <mcsm224@xxxxxxxxx>
>
> trace_repo_setup() of trace.c is called with the argument 'prefix' from
> only one location, run_builtin of git.c, which sets 'prefix' to the return
> value of setup_git_directory() or setup_git_directory_gently() (a wrapper
> of the former).

The former is the wrapper of the latter, though ;-)

> Now that "prefix" is in startup_info there is no need for the parameter
> of trace_repo_setup() because setup_git_directory() sets "startup_info->prefix"
> to the same value it returns. It would be less confusing to use "prefix"
> from startup_info instead of passing it as an argument.

... but for commands with neither RUN_SETUP|RUN_SETUP_GENTLY bits
requested, the prefix is set it to NULL by run_builtin(), and
setup_git_directory.  What value does startup_info->prefix get in
that case?  If we know it will always NULL (and I suspect that is
the case, but I haven't followed the codepaths myself to find it out
lately, so you should without taking my word blindly), saying that
at the same place you mentioned the return value of setup_git_*()
functions in the first paragraph would make the reasoning perfect.

Otherwise, very nicely done.

Thanks.




[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