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

[PATCH] export setup_git_env()

From
MLMatthias Lederhofer <matled@gmx.net>
Date
Apr 4, 2007, 20:09 UTC
Message-ID
<20070404200948.GA22782@moooo.ath.cx>
In-Reply-To
<20070328141505.GA16600@moooo.ath.cx>

After changing environment variables used by environment.c we need to call getenv() again. setup_git_env() does this and can now be used from other files too.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
 cache.h       |    1 +
 environment.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cache.h b/cache.h
index 384b260..7b49258 100644
--- a/cache.h
+++ b/cache.h
@@ -154,6 +154,7 @@ enum object_type {
 #define EXEC_PATH_ENVIRONMENT "GIT_EXEC_PATH"
 
 extern int is_bare_repository_cfg;
+extern void setup_git_env(void);
 extern int is_bare_repository(void);
 extern int is_inside_git_dir(void);
 extern const char *get_git_dir(void);
diff --git a/environment.c b/environment.c
index 2231659..713a011 100644
--- a/environment.c
+++ b/environment.c
@@ -35,7 +35,7 @@ int auto_crlf = 0;	/* 1: both ways, -1: only when adding git objects */
 static const char *git_dir;
 static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file;
 
-static void setup_git_env(void)
+void setup_git_env(void)
 {
 	git_dir = getenv(GIT_DIR_ENVIRONMENT);
 	if (!git_dir)
-- 
1.5.1.4.g446af-dirty
Previous: Matthias LederhoferNext: Matthias Lederhofer
Message 8 of 12 in “introduce GIT_WORK_TREE environment variable”
  1. introduce GIT_WORK_TREE environment variableMatthias Lederhofer, Mar 28, 2007
  2. Johannes SixtMar 28, 2007
  3. Matthias LederhoferMar 29, 2007
  4. Matthias LederhoferApr 4, 2007
  5. Dana HowApr 4, 2007
  6. Junio C HamanoApr 4, 2007
  7. Matthias LederhoferApr 4, 2007
  8. export setup_git_env()Matthias Lederhofer, Apr 4, 2007
  9. introduce GIT_WORK_TREE environment variableMatthias Lederhofer, Apr 4, 2007
  10. Junio C HamanoApr 4, 2007
  11. Matthias LederhoferApr 6, 2007
  12. Junio C HamanoApr 11, 2007

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.