From: Nguyễn Thái Ngọc Duy Date: Tue, 16 Feb 2010 16:04:56 GMT Subject: [WIP PATCH 05/26] enter_repo(): use setup_git_directory_gently internally Message-ID: <1266336317-607-6-git-send-email-pclouds@gmail.com> In-Reply-To: <1266336317-607-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/path.c b/path.c index 0005df3..6a311d7 100644 --- a/path.c +++ b/path.c @@ -281,6 +281,7 @@ char *enter_repo(char *path, int strict) { static char used_path[PATH_MAX]; static char validated_path[PATH_MAX]; + int nongit_ok; if (!path) return NULL; @@ -334,12 +335,9 @@ char *enter_repo(char *path, int strict) else if (chdir(path)) return NULL; - if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 && - validate_headref("HEAD") == 0) { - set_git_dir("."); - check_repository_format(); + setup_git_directory_gently(&nongit_ok); + if (!nongit_ok) return path; - } return NULL; } -- 1.7.0.195.g637a2