Merge branch 'nd/strbuf-utf8-replace'
[gitweb.git] / trace.c
diff --git a/trace.c b/trace.c
index e583dc63bb8d7062f8b735e701978574e9fcbf25..54aaee58183f880365caa1986824054a4533797e 100644 (file)
--- a/trace.c
+++ b/trace.c
@@ -298,13 +298,12 @@ void trace_repo_setup(const char *prefix)
 {
        static struct trace_key key = TRACE_KEY_INIT(SETUP);
        const char *git_work_tree;
-       char cwd[PATH_MAX];
+       char *cwd;
 
        if (!trace_want(&key))
                return;
 
-       if (!getcwd(cwd, PATH_MAX))
-               die("Unable to get current working directory");
+       cwd = xgetcwd();
 
        if (!(git_work_tree = get_git_work_tree()))
                git_work_tree = "(null)";
@@ -316,6 +315,8 @@ void trace_repo_setup(const char *prefix)
        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));
+
+       free(cwd);
 }
 
 int trace_want(struct trace_key *key)