summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-08-24 15:10:44 -0700
committerJunio C Hamano <gitster@pobox.com>2019-08-26 10:03:41 -0700
commitd17f2124a7860c2f37eaba574a867dbb4f506c27 (patch)
tree9a6a495c40f8432b81d12aec9d134f3e6068ab22 /setup.c
parent745f6812895b31c02b29bdfe4ae8e5498f776c26 (diff)
downloadgit-d17f2124a7860c2f37eaba574a867dbb4f506c27.tar.gz
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>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 8dcb4631f7..bb039ee14d 100644
--- a/setup.c
+++ b/setup.c
@@ -919,7 +919,7 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
const char *env_ceiling_dirs = getenv(CEILING_DIRECTORIES_ENVIRONMENT);
struct string_list ceiling_dirs = STRING_LIST_INIT_DUP;
const char *gitdirenv;
- int ceil_offset = -1, min_offset = has_dos_drive_prefix(dir->buf) ? 3 : 1;
+ int ceil_offset = -1, min_offset = offset_1st_component(dir->buf);
dev_t current_device = 0;
int one_filesystem = 1;