summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2006-08-23 12:39:11 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-23 18:47:38 -0700
commitc5fba16c500ad5847842876df0418664cddf6e50 (patch)
tree93ad8500fd4d1fe4c732e3aadf94645a8524048b /environment.c
parent60b7f38e0e08867b72022de5c20715d8eb72de24 (diff)
downloadgit-c5fba16c500ad5847842876df0418664cddf6e50.tar.gz
git_dir holds pointers to local strings, hence MUST be const.
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/environment.c b/environment.c
index e6bd0033b4..5fae9ac305 100644
--- a/environment.c
+++ b/environment.c
@@ -25,8 +25,9 @@ int zlib_compression_level = Z_DEFAULT_COMPRESSION;
int pager_in_use;
int pager_use_color = 1;
-static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir,
- *git_graft_file;
+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)
{
git_dir = getenv(GIT_DIR_ENVIRONMENT);
@@ -49,7 +50,7 @@ static void setup_git_env(void)
git_graft_file = strdup(git_path("info/grafts"));
}
-char *get_git_dir(void)
+const char *get_git_dir(void)
{
if (!git_dir)
setup_git_env();