summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'path.c')
-rw-r--r--path.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/path.c b/path.c
index aaa9345ebc..b4c8d91722 100644
--- a/path.c
+++ b/path.c
@@ -415,7 +415,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;
}
@@ -728,3 +728,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]);
+}