git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 24, 2019, 22:10 UTC
Message-ID
<bb29fcd20d3e3f59ed5d65f04148d73770f542b2.1566684643.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.141.git.gitgitgadget@gmail.com>
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 --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;
 
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 2 of 5 in “Handle worktrees at the top of a network drive”
  1. 0/3 Handle worktrees at the top of a network driveJohannes Schindelin via GitGitGadget, Aug 24, 2019
  2. 1/3 setup_git_directory(): handle UNC paths correctlyJohannes Schindelin via GitGitGadget, Aug 24, 2019
  3. 2/3 Fix .git/ discovery at the root of UNC sharesJohannes Schindelin via GitGitGadget, Aug 24, 2019
  4. 3/3 setup_git_directory(): handle UNC root paths correctlyJohannes Schindelin via GitGitGadget, Aug 24, 2019
  5. Junio C HamanoAug 26, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.