From: Junio C Hamano Date: Mon, 25 Mar 2013 21:00:44 +0000 (-0700) Subject: Merge branch 'jk/alias-in-bare' X-Git-Tag: v1.8.3-rc0~181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb3b7b1f95ce3c39f1116ebabf0bbcbfd3bb8796;p=git Merge branch 'jk/alias-in-bare' An aliased command spawned from a bare repository that does not say it is bare with "core.bare = yes" is treated as non-bare by mistake. * jk/alias-in-bare: setup: suppress implicit "." work-tree for bare repos environment: add GIT_PREFIX to local_repo_env cache.h: drop LOCAL_REPO_ENV_SIZE --- fb3b7b1f95ce3c39f1116ebabf0bbcbfd3bb8796 diff --cc cache.h index c56315ccc3,c1fe67ffcf..fc5c5b5733 --- a/cache.h +++ b/cache.h @@@ -362,16 -364,26 +364,27 @@@ static inline enum object_type object_t #define GIT_NOTES_DISPLAY_REF_ENVIRONMENT "GIT_NOTES_DISPLAY_REF" #define GIT_NOTES_REWRITE_REF_ENVIRONMENT "GIT_NOTES_REWRITE_REF" #define GIT_NOTES_REWRITE_MODE_ENVIRONMENT "GIT_NOTES_REWRITE_MODE" +#define GIT_LITERAL_PATHSPECS_ENVIRONMENT "GIT_LITERAL_PATHSPECS" /* - * 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. + * This environment variable is expected to contain a boolean indicating + * whether we should or should not treat: + * + * GIT_DIR=foo.git git ... + * + * as if GIT_WORK_TREE=. was given. It's not expected that users will make use + * of this, but we use it internally to communicate to sub-processes that we + * are in a bare repo. If not set, defaults to true. + */ + #define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_IMPLICIT_WORK_TREE" + + /* + * Repository-local GIT_* environment variables; these will be cleared + * when git spawns a sub-process that runs inside another repository. + * The array is NULL-terminated, which makes it easy to pass in the "env" + * parameter of a run-command invocation, or to do a simple walk. */ - #define LOCAL_REPO_ENV_SIZE 9 - extern const char *const local_repo_env[LOCAL_REPO_ENV_SIZE + 1]; + extern const char * const local_repo_env[]; extern int is_bare_repository_cfg; extern int is_bare_repository(void);