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

Misleading error message with invalid filename on Windows

From
JMJosh Mandel <jmandel@gmail.com>
Date
Mar 14, 2019, 22:31 UTC
Message-ID
<CANSMLKELiaTR81zscG6Or9psL2ZLizAtYEqT72WGHdY92sAFQA@mail.gmail.com>
In-Reply-To
<CANSMLKFUXza=qj14gOd+jzX+R+R_JDO8XqmrjXYukB9s0FDhMQ@mail.gmail.com>

Running git 2.21.0 on Windows with certain invalid file names like "c:\root.txt" (see https://github.com/jmandel/local-path-test as a test case), I get an expected "invalid path" error when I clone the repository.

But if I actually have a file at this path (i.e., outside of the git working tree, at root of my file system) then I instead receive a different error message:

$ touch /c/root.txt $ git clone https://github.com/jmandel/local-path-test.git

> error: Untracked working tree file 'c:\root.txt' would be overwritten by merge.

This error message is misleading, in that (if I understand correctly) there's actually no danger of my local file (which is *not* in the working tree at all) being overwritten.

Best, Josh

Message 1 of 1 in “Misleading error message with invalid filename on Windows”
  1. Josh MandelMar 14, 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.