diff mbox series

[1/3] setup_git_directory(): handle UNC paths correctly

Message ID bb29fcd20d3e3f59ed5d65f04148d73770f542b2.1566684643.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Handle worktrees at the top of a network drive | expand

Commit Message

John Passaro via GitGitGadget Aug. 24, 2019, 10:10 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/setup.c b/setup.c
index ca9e8a949e..a803b3ade3 100644
--- a/setup.c
+++ b/setup.c
@@ -906,7 +906,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;