From b44ebb19e3234c5dffe9869ceac5408bb44c2e20 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Wed, 20 Feb 2008 23:13:13 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- environment.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'environment.c') diff --git a/environment.c b/environment.c index 6739a3f417..fcd1ee5ef8 100644 --- a/environment.c +++ b/environment.c @@ -49,6 +49,8 @@ static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file; 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); -- cgit v1.3