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

Re: [PATCH mm/mv-file-to-no-such-dir-with-slash] mv: let 'git mv file no-such-dir/' error out on Windows, too

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2014, 19:30 UTC
Message-ID
<xmqqd2jz8wi9.fsf@gitster.dls.corp.google.com>
In-Reply-To
<52D04856.9070005@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 22 quoted lines
> The file is renamed to no-such-dir without the slash at the end. The
> updated commit message would be:
>
> mv: let 'git mv file no-such-dir/' error out on Windows, too
>
> The previous commit c57f628 (mv: let 'git mv file no-such-dir/' error out)
> relies on that rename("src", "dst/") fails if directory dst does not
> exist (note the trailing slash). This does not work as expected on Windows:
> The rename() call does not fail, but renames src to dst (without the
> trailing slash). Insert an explicit check for this case to force an error.
>
> This changes the error message from
>
>    $ git mv file no-such-dir/
>    fatal: renaming 'file' failed: Not a directory
>
> to
>
>    $ git mv file no-such-dir/
>    fatal: destination directory does not exist, source=file, destination=no-such-dir/
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Thanks.
Previous: Johannes Sixt
Message 11 of 11 in “mv: let 'git mv file no-such-dir/' error out”
  1. mv: let 'git mv file no-such-dir/' error outMatthieu Moy, Dec 3, 2013
  2. Duy NguyenDec 3, 2013
  3. Matthieu MoyDec 4, 2013
  4. Duy NguyenDec 4, 2013
  5. mv: let 'git mv file no-such-dir/' error outMatthieu Moy, Dec 4, 2013
  6. Junio C HamanoDec 4, 2013
  7. Matthieu MoyDec 4, 2013
  8. mv: let 'git mv file no-such-dir/' error out on Windows, tooJohannes Sixt, Jan 8, 2014
  9. Junio C HamanoJan 9, 2014
  10. Johannes SixtJan 10, 2014
  11. Junio C HamanoJan 10, 2014

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.