git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] config.c: remove static keyword from git_env_bool()

From
Lars R. Damerow <lars@pixar.com>
Date
Mar 16, 2010, 22:05 UTC
Message-ID
<1268777101-22122-2-git-send-email-lars@pixar.com>
In-Reply-To
<1268777101-22122-1-git-send-email-lars@pixar.com>

Since this function is the preferred way to handle boolean environment variables it's useful to have it available to other files.

Signed-off-by: Lars R. Damerow <lars@pixar.com>
---
 cache.h  |    1 +
 config.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cache.h b/cache.h
index 89f6a40..c29030f 100644
--- a/cache.h
+++ b/cache.h
@@ -945,6 +945,7 @@ extern int git_config_set_multivar(const char *, const char *, const char *, int
 extern int git_config_rename_section(const char *, const char *);
 extern const char *git_etc_gitconfig(void);
 extern int check_repository_format_version(const char *var, const char *value, void *cb);
+extern int git_env_bool(const char *, int);
 extern int git_config_system(void);
 extern int git_config_global(void);
 extern int config_error_nonbool(const char *);
diff --git a/config.c b/config.c
index 6963fbe..70e4600 100644
--- a/config.c
+++ b/config.c
@@ -683,7 +683,7 @@ const char *git_etc_gitconfig(void)
 	return system_wide;
 }
 
-static int git_env_bool(const char *k, int def)
+int git_env_bool(const char *k, int def)
 {
 	const char *v = getenv(k);
 	return v ? git_config_bool(k, v) : def;
-- 
1.6.5.2
Previous: Lars R. DamerowNext: Lars R. Damerow
Message 2 of 5 in “Add support for GIT_ONE_FILESYSTEM (resubmission)”
  1. 0/2 Add support for GIT_ONE_FILESYSTEM (resubmission)Lars R. Damerow, Mar 16, 2010
  2. 1/2 config.c: remove static keyword from git_env_bool()Lars R. Damerow, Mar 16, 2010
  3. 2/2 Add support for GIT_ONE_FILESYSTEMLars R. Damerow, Mar 16, 2010
  4. Nguyen Thai Ngoc DuyMar 17, 2010
  5. Johannes SixtMar 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.