diff options
author | idriss fekir <mcsm224@gmail.com> | 2023-02-19 03:25:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-21 23:06:32 +0300 |
commit | 17ab64e1b57b84d551a10e516d2722367e00e76c (patch) | |
tree | 5bf2e4b450306be5712d9f07fcf39fc24f7fcadf /trace.c | |
parent | d9d677b2d8cc5f70499db04e633ba7a400f64cbf (diff) |
trace.c, git.c: remove unnecessary parameter to trace_repo_setup()
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).
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.
Signed-off-by: Idriss Fekir <mcsm224@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace.c')
-rw-r--r-- | trace.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -291,10 +291,9 @@ static const char *quote_crnl(const char *path) return new_path.buf; } -/* FIXME: move prefix to startup_info struct and get rid of this arg */ -void trace_repo_setup(const char *prefix) +void trace_repo_setup(void) { - const char *git_work_tree; + const char *git_work_tree, *prefix = startup_info->prefix; char *cwd; if (!trace_want(&trace_setup_key)) @@ -305,7 +304,7 @@ void trace_repo_setup(const char *prefix) if (!(git_work_tree = get_git_work_tree())) git_work_tree = "(null)"; - if (!prefix) + if (!startup_info->prefix) prefix = "(null)"; trace_printf_key(&trace_setup_key, "setup: git_dir: %s\n", quote_crnl(get_git_dir())); |