summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-03-08 09:30:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-08 22:02:31 (GMT)
commita6f7f9a32532a636bd458c7a3dc2cc16fbe237d3 (patch)
treef53333b3d0826c6dee73dc321d79ece33e6f2d0c /cache.h
parent2163e5dbb4cad43d65a4ffc8daeacff5eedd7af9 (diff)
downloadgit-a6f7f9a32532a636bd458c7a3dc2cc16fbe237d3.zip
git-a6f7f9a32532a636bd458c7a3dc2cc16fbe237d3.tar.gz
git-a6f7f9a32532a636bd458c7a3dc2cc16fbe237d3.tar.bz2
environment: add GIT_PREFIX to local_repo_env
The GIT_PREFIX variable is set based on our location within the working tree. It should therefore be cleared whenever GIT_WORK_TREE is cleared. In practice, this doesn't cause any bugs, because none of the sub-programs we invoke with local_repo_env cleared actually care about GIT_PREFIX. But this is the right thing to do, and future proofs us against that assumption changing. While we're at it, let's define a GIT_PREFIX_ENVIRONMENT macro; this avoids repetition of the string literal, which can help catch any spelling mistakes in the code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 139b911..3c6b677 100644
--- a/cache.h
+++ b/cache.h
@@ -345,6 +345,7 @@ static inline enum object_type object_type(unsigned int mode)
#define GIT_DIR_ENVIRONMENT "GIT_DIR"
#define GIT_NAMESPACE_ENVIRONMENT "GIT_NAMESPACE"
#define GIT_WORK_TREE_ENVIRONMENT "GIT_WORK_TREE"
+#define GIT_PREFIX_ENVIRONMENT "GIT_PREFIX"
#define DEFAULT_GIT_DIR_ENVIRONMENT ".git"
#define DB_ENVIRONMENT "GIT_OBJECT_DIRECTORY"
#define INDEX_ENVIRONMENT "GIT_INDEX_FILE"