Git fork

trace.c: export trace_setup_key

This is so that we can print traces based on this key outside trace.c.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Nguyễn Thái Ngọc Duy and committed by
Junio C Hamano
cb507619 48988c4d

+8 -7
+7 -7
trace.c
··· 26 26 27 27 struct trace_key trace_default_key = { "GIT_TRACE", 0, 0, 0 }; 28 28 struct trace_key trace_perf_key = TRACE_KEY_INIT(PERFORMANCE); 29 + struct trace_key trace_setup_key = TRACE_KEY_INIT(SETUP); 29 30 30 31 /* Get a trace file descriptor from "key" env variable. */ 31 32 static int get_trace_fd(struct trace_key *key) ··· 300 301 /* FIXME: move prefix to startup_info struct and get rid of this arg */ 301 302 void trace_repo_setup(const char *prefix) 302 303 { 303 - static struct trace_key key = TRACE_KEY_INIT(SETUP); 304 304 const char *git_work_tree; 305 305 char *cwd; 306 306 307 - if (!trace_want(&key)) 307 + if (!trace_want(&trace_setup_key)) 308 308 return; 309 309 310 310 cwd = xgetcwd(); ··· 315 315 if (!prefix) 316 316 prefix = "(null)"; 317 317 318 - trace_printf_key(&key, "setup: git_dir: %s\n", quote_crnl(get_git_dir())); 319 - trace_printf_key(&key, "setup: git_common_dir: %s\n", quote_crnl(get_git_common_dir())); 320 - trace_printf_key(&key, "setup: worktree: %s\n", quote_crnl(git_work_tree)); 321 - trace_printf_key(&key, "setup: cwd: %s\n", quote_crnl(cwd)); 322 - trace_printf_key(&key, "setup: prefix: %s\n", quote_crnl(prefix)); 318 + trace_printf_key(&trace_setup_key, "setup: git_dir: %s\n", quote_crnl(get_git_dir())); 319 + trace_printf_key(&trace_setup_key, "setup: git_common_dir: %s\n", quote_crnl(get_git_common_dir())); 320 + trace_printf_key(&trace_setup_key, "setup: worktree: %s\n", quote_crnl(git_work_tree)); 321 + trace_printf_key(&trace_setup_key, "setup: cwd: %s\n", quote_crnl(cwd)); 322 + trace_printf_key(&trace_setup_key, "setup: prefix: %s\n", quote_crnl(prefix)); 323 323 324 324 free(cwd); 325 325 }
+1
trace.h
··· 15 15 16 16 #define TRACE_KEY_INIT(name) { "GIT_TRACE_" #name, 0, 0, 0 } 17 17 extern struct trace_key trace_perf_key; 18 + extern struct trace_key trace_setup_key; 18 19 19 20 extern void trace_repo_setup(const char *prefix); 20 21 extern int trace_want(struct trace_key *key);