From: Junio C Hamano Date: Fri, 10 Jan 2014 19:30:54 GMT Subject: Re: [PATCH mm/mv-file-to-no-such-dir-with-slash] mv: let 'git mv file no-such-dir/' error out on Windows, too Message-ID: In-Reply-To: <52D04856.9070005@kdbg.org> Johannes Sixt writes: > 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 Thanks.