Skip to content

Commit 506bd0e

Browse files
committed
Merge branch 'if/simplify-trace-setup'
Code clean-up. * if/simplify-trace-setup: trace.c, git.c: remove unnecessary parameter to trace_repo_setup()
2 parents 630501c + 17ab64e commit 506bd0e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

git.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
430430
use_pager = 1;
431431
if (run_setup && startup_info->have_repository)
432432
/* get_git_dir() may set up repo, avoid that */
433-
trace_repo_setup(prefix);
433+
trace_repo_setup();
434434
commit_pager_choice();
435435

436436
if (!help && p->option & NEED_WORK_TREE)

trace.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,9 @@ static const char *quote_crnl(const char *path)
291291
return new_path.buf;
292292
}
293293

294-
/* FIXME: move prefix to startup_info struct and get rid of this arg */
295-
void trace_repo_setup(const char *prefix)
294+
void trace_repo_setup(void)
296295
{
297-
const char *git_work_tree;
296+
const char *git_work_tree, *prefix = startup_info->prefix;
298297
char *cwd;
299298

300299
if (!trace_want(&trace_setup_key))
@@ -305,7 +304,7 @@ void trace_repo_setup(const char *prefix)
305304
if (!(git_work_tree = get_git_work_tree()))
306305
git_work_tree = "(null)";
307306

308-
if (!prefix)
307+
if (!startup_info->prefix)
309308
prefix = "(null)";
310309

311310
trace_printf_key(&trace_setup_key, "setup: git_dir: %s\n", quote_crnl(get_git_dir()));

trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extern struct trace_key trace_default_key;
9393
extern struct trace_key trace_perf_key;
9494
extern struct trace_key trace_setup_key;
9595

96-
void trace_repo_setup(const char *prefix);
96+
void trace_repo_setup(void);
9797

9898
/**
9999
* Checks whether the trace key is enabled. Used to prevent expensive

0 commit comments

Comments
 (0)