setup_git_directory(): handle UNC paths correctly
The first offset in a UNC path is not the host name, but the folder name after that. This fixes https://github.com/git-for-windows/git/issues/1181 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Aug 24, 2019 at 15:10 UTC
d17f2124a7860c2f37eaba574a867dbb4f506c27
1 file changed
+1
-1
setup.c
+1
-1
@@ -919,7 +919,7 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
919
const char *env_ceiling_dirs = getenv(CEILING_DIRECTORIES_ENVIRONMENT);
920
struct string_list ceiling_dirs = STRING_LIST_INIT_DUP;
921
const char *gitdirenv;
922
- int ceil_offset = -1, min_offset = has_dos_drive_prefix(dir->buf) ? 3 : 1;
922
+ int ceil_offset = -1, min_offset = offset_1st_component(dir->buf);
923
dev_t current_device = 0;
924
int one_filesystem = 1;
925