summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2008-02-20 23:13:13 +0100
committerJunio C Hamano <gitster@pobox.com>2008-04-09 01:22:50 -0700
commitb44ebb19e3234c5dffe9869ceac5408bb44c2e20 (patch)
tree958b2cbe3274a0de21b3751c0caff511e5d4d783 /environment.c
parent2a5fe2545882721d6841bad11dae0f15b454bf0d (diff)
downloadgit-b44ebb19e3234c5dffe9869ceac5408bb44c2e20.tar.gz
Add platform-independent .git "symlink"
This patch allows .git to be a regular textfile containing the path of the real git directory (prefixed with "gitdir: "), which can be useful on platforms lacking support for real symlinks. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/environment.c b/environment.c
index 6739a3f417..fcd1ee5ef8 100644
--- a/environment.c
+++ b/environment.c
@@ -50,6 +50,8 @@ static void setup_git_env(void)
{
git_dir = getenv(GIT_DIR_ENVIRONMENT);
if (!git_dir)
+ git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
+ if (!git_dir)
git_dir = DEFAULT_GIT_DIR_ENVIRONMENT;
git_object_dir = getenv(DB_ENVIRONMENT);
if (!git_object_dir) {