mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
setup (Windows): Revert leftovers of old implementation
The handling of paths was resolved differently in the MinGW port that is merged to official git. This commit takes this implementation. Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
7
setup.c
7
setup.c
@@ -381,7 +381,6 @@ const char *setup_git_directory_gently(int *nongit_ok)
|
||||
const char *gitdirenv;
|
||||
const char *gitfile_dir;
|
||||
int len, offset, ceil_offset;
|
||||
int minoffset = 0;
|
||||
|
||||
/*
|
||||
* Let's assume that we are in a git repository.
|
||||
@@ -432,8 +431,6 @@ const char *setup_git_directory_gently(int *nongit_ok)
|
||||
|
||||
if (!getcwd(cwd, sizeof(cwd)-1))
|
||||
die("Unable to read current working directory");
|
||||
if (has_dos_drive_prefix(cwd))
|
||||
minoffset = 2;
|
||||
|
||||
ceil_offset = longest_ancestor_length(cwd, env_ceiling_dirs);
|
||||
if (ceil_offset < 0 && has_dos_drive_prefix(cwd))
|
||||
@@ -464,11 +461,11 @@ const char *setup_git_directory_gently(int *nongit_ok)
|
||||
inside_git_dir = 1;
|
||||
if (!work_tree_env)
|
||||
inside_work_tree = 0;
|
||||
set_git_dir(".");
|
||||
setenv(GIT_DIR_ENVIRONMENT, ".", 1);
|
||||
check_repository_format_gently(nongit_ok);
|
||||
return NULL;
|
||||
}
|
||||
while (offset > minoffset && --offset > ceil_offset && cwd[offset] != '/');
|
||||
while (--offset > ceil_offset && cwd[offset] != '/');
|
||||
if (offset <= ceil_offset) {
|
||||
if (nongit_ok) {
|
||||
if (chdir(cwd))
|
||||
|
||||
Reference in New Issue
Block a user