From: Junio C Hamano Date: Fri, 19 Sep 2014 18:38:39 +0000 (-0700) Subject: Merge branch 'kb/perf-trace' X-Git-Tag: v2.2.0-rc0~104 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9ee9c9d068d841908c7022aad566096be8a439a9?ds=inline;hp=-c Merge branch 'kb/perf-trace' Compilation fix for some compilers. * kb/perf-trace: trace: correct trace_strbuf() parameter type for !HAVE_VARIADIC_MACROS --- 9ee9c9d068d841908c7022aad566096be8a439a9 diff --combined trace.c index 54aaee5818,17015fdb81..b6f25a23fd --- a/trace.c +++ b/trace.c @@@ -216,7 -216,7 +216,7 @@@ void trace_argv_printf(const char **arg va_end(ap); } - void trace_strbuf(const char *key, const struct strbuf *data) + void trace_strbuf(struct trace_key *key, const struct strbuf *data) { trace_strbuf_fl(NULL, 0, key, data); } @@@ -298,12 -298,13 +298,12 @@@ void trace_repo_setup(const char *prefi { 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)"; @@@ -315,8 -316,6 +315,8 @@@ 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)