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

Git bug - Windows subst/net use, Windows drive letter prefix

From
PSPaul D. Smith <paul.d.smith@metaswitch.com>
Date
Jul 16, 2020, 11:03 UTC
Message-ID
<DM6PR02MB5276FB15B1E9E66E98A0B7AFBD7F0@DM6PR02MB5276.namprd02.prod.outlook.com>
In-Reply-To
<DM6PR02MB52769C88FFC893FE3D44E901BD7F0@DM6PR02MB5276.namprd02.prod.outlook.com>
I believe there is a subtle bug in Git that can mean that a "git add" fails, complaining that "fatal: <filename>: '<filename>' is outside repository at '//<server>/<share>/<directory> /'
It may be possible to reproduce this with simpler steps, but this is what I have that fails.
1. A Git repo on system <server> below directory <directory> that can be reached via the Windows share <share>
2. On a second system, perform "net use z: file://%3cserver%3e/%3cshare>"
3. Now you can "cd /d z:\<directory>" and run "git status" quite happily 
4. At this point I can also so this:
	a. "cd /d z:" then "git add <z:\some-changed-file>"
		i. Note the drive letter prefixing the full-filename
5. Now do a subst or a net use as follows:
	a. subst v: z:\directory
	b. net use w: file://%3cserver%3e/%3cshare%3e/%3cdirectory>
6. You can do both of these
	a. "cd /d v:" then "git status"
	b. "cd /d w:" then "git status"
7. However both of these FAIL:
	a. "cd /d v:" then "git add <v:\some-changed-file>"
	b. "cd /d w:" then "git add <w:\some-changed-file>"
		i. Note the drive letter prefixing the full-filename
8. Performing the above requests WITHOUT the drive letter prefixing the filename works!
I assume that this is supposed to work and there is some subtle error merging the repository root and the filename-with-drive-prefix.

Regards, Paul D.Smith.

Next: Torsten Bögershausen
Message 1 of 3 in “Git bug - Windows subst/net use, Windows drive letter prefix”
  1. Paul D. SmithJul 16, 2020
  2. Torsten BögershausenJul 19, 2020
  3. Paul D. SmithJul 20, 2020

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.