summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-03-08 04:29:08 -0500
committerJunio C Hamano <gitster@pobox.com>2013-03-08 07:55:54 -0800
commit2163e5dbb4cad43d65a4ffc8daeacff5eedd7af9 (patch)
treed58656a76efcffebbccabc50365ed26de4b7f99d /environment.c
parent5d4ef1721ad873b8d0db1c4fc55ad9316accf2cb (diff)
downloadgit-2163e5dbb4cad43d65a4ffc8daeacff5eedd7af9.tar.gz
cache.h: drop LOCAL_REPO_ENV_SIZE
We keep a static array of variables that should be cleared when invoking a sub-process on another repo. We statically size the array with the LOCAL_REPO_ENV_SIZE macro so that any readers do not have to count it themselves. As it turns out, no readers actually use the macro, and it creates a maintenance headache, as modifications to the array need to happen in two places (one to add the new element, and another to bump the size). Since it's NULL-terminated, we can just drop the size macro entirely. While we're at it, we'll clean up some comments around it, and add a new mention of it at the top of the list of environment variable macros. Even though local_repo_env is right below that list, it's easy to miss, and additions to that list should consider local_repo_env. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/environment.c b/environment.c
index 85edd7f95a..81ffb4b666 100644
--- a/environment.c
+++ b/environment.c
@@ -76,11 +76,9 @@ static const char *git_dir;
static char *git_object_dir, *git_index_file, *git_graft_file;
/*
- * Repository-local GIT_* environment variables
- * Remember to update local_repo_env_size in cache.h when
- * the size of the list changes
+ * Repository-local GIT_* environment variables; see cache.h for details.
*/
-const char * const local_repo_env[LOCAL_REPO_ENV_SIZE + 1] = {
+const char * const local_repo_env[] = {
ALTERNATE_DB_ENVIRONMENT,
CONFIG_ENVIRONMENT,
CONFIG_DATA_ENVIRONMENT,