]> asedeno.scripts.mit.edu Git - git.git/blobdiff - path.c
Sync with 1.7.0 series
[git.git] / path.c
diff --git a/path.c b/path.c
index f6226fcd557b1b06706775cb3a32cc780ee2b708..6b23023095d7e1a5cfc1aef8db6d6e5fb56b32de 100644 (file)
--- a/path.c
+++ b/path.c
@@ -417,7 +417,7 @@ char *enter_repo(char *path, int strict)
 
        if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 &&
            validate_headref("HEAD") == 0) {
-               setenv(GIT_DIR_ENVIRONMENT, ".", 1);
+               set_git_dir(".");
                check_repository_format();
                return path;
        }
@@ -730,3 +730,10 @@ int daemon_avoid_alias(const char *p)
                }
        }
 }
+
+int offset_1st_component(const char *path)
+{
+       if (has_dos_drive_prefix(path))
+               return 2 + is_dir_sep(path[2]);
+       return is_dir_sep(path[0]);
+}