Merge branch 'jk/alias-in-bare'
authorJunio C Hamano <gitster@pobox.com>
Mon, 25 Mar 2013 21:00:44 +0000 (14:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Mar 2013 21:00:44 +0000 (14:00 -0700)
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

1  2 
cache.h
environment.c
git.c
setup.c
diff --cc cache.h
index c56315ccc3605654ff4a08a8b74cc8f25cfb2b41,c1fe67ffcfb1e792658d8d2c889e21f28ea78a94..fc5c5b5733784982a020bad1d2af731816e55205
+++ 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);
diff --cc environment.c
Simple merge
diff --cc git.c
Simple merge
diff --cc setup.c
Simple merge