summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-02-27 10:08:57 -0800
committerJunio C Hamano <gitster@pobox.com>2023-02-27 10:08:58 -0800
commit506bd0ec82d0b51d49a8e0c6fbe37b23619b0938 (patch)
tree7f91de43e81ac7d300821ed1856438b6ad8a87c7
parent630501ceef6a70203f89ab62c9909c96a2d751ec (diff)
parent17ab64e1b57b84d551a10e516d2722367e00e76c (diff)
Merge branch 'if/simplify-trace-setup'
Code clean-up. * if/simplify-trace-setup: trace.c, git.c: remove unnecessary parameter to trace_repo_setup()
-rw-r--r--git.c2
-rw-r--r--trace.c7
-rw-r--r--trace.h2
3 files changed, 5 insertions, 6 deletions
diff --git a/git.c b/git.c
index 96b0a2837d..6171fd6769 100644
--- a/git.c
+++ b/git.c
@@ -430,7 +430,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
use_pager = 1;
if (run_setup && startup_info->have_repository)
/* get_git_dir() may set up repo, avoid that */
- trace_repo_setup(prefix);
+ trace_repo_setup();
commit_pager_choice();
if (!help && p->option & NEED_WORK_TREE)
diff --git a/trace.c b/trace.c
index 794a087c21..efa4e2d8e0 100644
--- a/trace.c
+++ b/trace.c
@@ -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()));
diff --git a/trace.h b/trace.h
index 4e771f86ac..b6e35b9470 100644
--- a/trace.h
+++ b/trace.h
@@ -93,7 +93,7 @@ extern struct trace_key trace_default_key;
extern struct trace_key trace_perf_key;
extern struct trace_key trace_setup_key;
-void trace_repo_setup(const char *prefix);
+void trace_repo_setup(void);
/**
* Checks whether the trace key is enabled. Used to prevent expensive