Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'trace.c')
-rw-r--r--trace.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/trace.c b/trace.c
index 1d0e17e014..ca0ab0448b 100644
--- a/trace.c
+++ b/trace.c
@@ -148,10 +148,8 @@ void trace_repo_setup(const char *prefix)
{
const char *git_work_tree;
char cwd[PATH_MAX];
- char *trace = getenv("GIT_TRACE");
- if (!trace || !strcmp(trace, "") ||
- !strcmp(trace, "0") || !strcasecmp(trace, "false"))
+ if (!trace_want("GIT_TRACE"))
return;
if (!getcwd(cwd, PATH_MAX))
@@ -168,3 +166,13 @@ void trace_repo_setup(const char *prefix)
trace_printf("setup: cwd: %s\n", quote_crnl(cwd));
trace_printf("setup: prefix: %s\n", quote_crnl(prefix));
}
+
+int trace_want(const char *key)
+{
+ const char *trace = getenv(key);
+
+ if (!trace || !strcmp(trace, "") ||
+ !strcmp(trace, "0") || !strcasecmp(trace, "false"))
+ return 0;
+ return 1;
+}