enter_repo: avoid duplicating logic, use is_git_directory() instead
[gitweb.git] / path.c
diff --git a/path.c b/path.c
index a536ee329fd63c1e3ab4336d0a1fe019af94cb91..7340e11d7db833c7653d33163294217670e4d170 100644 (file)
--- 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;