From 225aab5d6a611076b22f00ae5a28184d92b5259c Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Mon, 28 Apr 2014 16:47:39 -0700 Subject: Don't use trace if GIT_TRACE not defined --- tests/status/worktree.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/status') diff --git a/tests/status/worktree.c b/tests/status/worktree.c index 0b94fb1a0..c1d6be982 100644 --- a/tests/status/worktree.c +++ b/tests/status/worktree.c @@ -7,6 +7,7 @@ #include "path.h" #include +#ifdef GIT_TRACE static struct { size_t stat_calls; size_t oid_calcs; @@ -29,11 +30,14 @@ static void add_stats(git_trace_level_t level, const char *msg) else if (!strncmp("oid_calculation", msg, (assign - msg))) g_diff_perf.oid_calcs += atoi(assign + 1); } +#endif void test_status_worktree__initialize(void) { +#ifdef GIT_TRACE memset(&g_diff_perf, 0, sizeof(g_diff_perf)); cl_git_pass(git_trace_set(GIT_TRACE_TRACE, add_stats)); +#endif } /** @@ -45,7 +49,9 @@ void test_status_worktree__initialize(void) void test_status_worktree__cleanup(void) { cl_git_sandbox_cleanup(); +#ifdef GIT_TRACE cl_git_pass(git_trace_set(0, NULL)); +#endif } /** -- cgit v1.2.1