Code

completion: don't declare 'local words' to make zsh happy
[git.git] / trace.c
diff --git a/trace.c b/trace.c
index 9f39eab025248511449a2dc6921578510e8429b4..d95341693fa9b27caed38ffe1308838bedb49f83 100644 (file)
--- a/trace.c
+++ b/trace.c
@@ -75,7 +75,7 @@ void trace_vprintf(const char *key, const char *fmt, va_list ap)
        strbuf_release(&buf);
 }
 
-void trace_printf_key(const char *key, const char *fmt, ...)
+static void trace_printf_key(const char *key, const char *fmt, ...)
 {
        va_list ap;
        va_start(ap, fmt);
@@ -155,10 +155,11 @@ static const char *quote_crnl(const char *path)
 /* FIXME: move prefix to startup_info struct and get rid of this arg */
 void trace_repo_setup(const char *prefix)
 {
+       static const char *key = "GIT_TRACE_SETUP";
        const char *git_work_tree;
        char cwd[PATH_MAX];
 
-       if (!trace_want("GIT_TRACE"))
+       if (!trace_want(key))
                return;
 
        if (!getcwd(cwd, PATH_MAX))
@@ -170,10 +171,10 @@ void trace_repo_setup(const char *prefix)
        if (!prefix)
                prefix = "(null)";
 
-       trace_printf("setup: git_dir: %s\n", quote_crnl(get_git_dir()));
-       trace_printf("setup: worktree: %s\n", quote_crnl(git_work_tree));
-       trace_printf("setup: cwd: %s\n", quote_crnl(cwd));
-       trace_printf("setup: prefix: %s\n", quote_crnl(prefix));
+       trace_printf_key(key, "setup: git_dir: %s\n", quote_crnl(get_git_dir()));
+       trace_printf_key(key, "setup: worktree: %s\n", quote_crnl(git_work_tree));
+       trace_printf_key(key, "setup: cwd: %s\n", quote_crnl(cwd));
+       trace_printf_key(key, "setup: prefix: %s\n", quote_crnl(prefix));
 }
 
 int trace_want(const char *key)