Fix "do not DWIM" patch to enter_repo"
authorJunio C Hamano <junkio@cox.net>
Mon, 21 Nov 2005 07:37:13 +0000 (23:37 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 21 Nov 2005 07:37:13 +0000 (23:37 -0800)
We wanted --strict to mean "do not DWIM", but the code required to
see absolute path. daemon does its own path verification and chdirs
to the verified repository, so enter_repo() called from upload-pack
will always enter ".". Requiring absolute path does not make any sense.

Signed-off-by: Junio C Hamano <junkio@cox.net>
path.c
diff --git a/path.c b/path.c
index 84b3272d94dbc301131d55660be41d5150a1cdef..4d889473a78a2c6fa38a0b54a48fe55bd83e9b02 100644 (file)
--- a/path.c
+++ b/path.c
@@ -181,7 +181,7 @@ char *enter_repo(char *path, int strict)
                return NULL;
 
        if (strict) {
-               if((path[0] != '/') || chdir(path) < 0)
+               if (chdir(path) < 0)
                        return NULL;
        }
        else {