From 48a7c1c49d675fa37b609b499dd9e27439ec7f51 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 25 Feb 2010 00:34:14 +0100 Subject: Refactor list of of repo-local env vars Move the list of GIT_* environment variables that are local to a repository into a static list in environment.c, as it is also useful elsewhere. Also add the missing GIT_CONFIG variable to the list. Make it easy to use the list both by NULL-termination and by size; the latter (excluding the terminating NULL) is stored in the local_repo_env_size define. Signed-off-by: Giuseppe Bilotta Signed-off-by: Junio C Hamano --- cache.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index d478eff1f..58209adbd 100644 --- a/cache.h +++ b/cache.h @@ -388,6 +388,15 @@ static inline enum object_type object_type(unsigned int mode) #define GIT_NOTES_REF_ENVIRONMENT "GIT_NOTES_REF" #define GIT_NOTES_DEFAULT_REF "refs/notes/commits" +/* + * Repository-local GIT_* environment variables + * The array is NULL-terminated to simplify its usage in contexts such + * environment creation or simple walk of the list. + * The number of non-NULL entries is available as a macro. + */ +#define LOCAL_REPO_ENV_SIZE 8 +extern const char *const local_repo_env[LOCAL_REPO_ENV_SIZE + 1]; + extern int is_bare_repository_cfg; extern int is_bare_repository(void); extern int is_inside_git_dir(void); -- cgit v1.2.1