Subject: [PATCH 02/16] enter_repo(): initialize other variables as setup_git_directory_gently() does

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Thu, 11 Mar 2010 20:22:20 +0700

Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 setup.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/setup.c b/setup.c
index 3019da2..e067292 100644
--- a/setup.c
+++ b/setup.c
@@ -535,8 +535,14 @@ char *enter_repo(char *path, int strict)
 
 	if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 &&
 	    validate_headref("HEAD") == 0) {
-		set_git_dir(".");
+		inside_work_tree = 0;
+		inside_git_dir = 1;
 		check_repository_format();
+		set_git_dir(".");
+		if (startup_info) {
+			startup_info->prefix = NULL;
+			startup_info->have_repository = 1;
+		}
 		return path;
 	}
 
-- 
1.7.0.1.384.g6abcaa