Code

[PATCH] Fix test failure due to overly strict .git directory tests
authorLinus Torvalds <torvalds@osdl.org>
Wed, 17 Aug 2005 02:50:37 +0000 (19:50 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 17 Aug 2005 04:33:22 +0000 (21:33 -0700)
We may not actually have a valid HEAD at all times, so relax the validity
tests for a .git subdirectory accordingly.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
setup.c

diff --git a/setup.c b/setup.c
index 453bddbb17365c8b090757c544edcc0a61fc96fb..896fca5032ac49758904532124be6f3b4bbab625 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -81,10 +81,9 @@ const char *setup_git_directory(void)
        offset = len = strlen(cwd);
        for (;;) {
                /*
-                * We always want to see a .git/HEAD and a .git/refs/
-                * subdirectory
+                * We always want to see a .git/refs/ subdirectory
                 */
-               if (!access(".git/HEAD", R_OK) && !access(".git/refs/", X_OK)) {
+               if (!access(".git/refs/", X_OK)) {
                        /*
                         * Then we need either a GIT_OBJECT_DIRECTORY define
                         * or a .git/objects/ directory