From: Nguyễn Thái Ngọc Duy Date: Sun, 13 Sep 2015 01:02:25 GMT Subject: [PATCH v3 2/5] enter_repo: avoid duplicating logic, use is_git_directory() instead Message-ID: <1442106148-22895-3-git-send-email-pclouds@gmail.com> In-Reply-To: <1442106148-22895-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/path.c b/path.c index a536ee3..7340e11 100644 --- a/path.c +++ b/path.c @@ -441,8 +441,7 @@ const char *enter_repo(const 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) { + if (is_git_directory(".")) { set_git_dir("."); check_repository_format(); return path; -- 2.3.0.rc1.137.g477eb31