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

Re: regarding fix on "git clone $there $here"

From
Jeff King <peff@peff.net>
Date
May 9, 2018, 06:41 UTC
Message-ID
<20180509064131.GA26636@sigill.intra.peff.net>
In-Reply-To
<2F384E33-2101-4D90-986B-FAE2FC2AD7C5@pensando.io>
On Tue, May 08, 2018 at 10:25:58PM -0700, Leslie Wang wrote:
Show 17 quoted lines
> Recently we try to upgrade ubuntu from 17.10 to 18.04, then we found
> one inconsistent behavior on git clone.
> 
> At 2.14.1 or 2.15.1, if I run command like 
>  - mkdir /tmp/111
>  - git clone git@github.com:111/111 /tmp/111
> 
> because it will failure, then /tmp/111 will be removed automatically.
> 
> However, at latest 2.17.0 which is part of ubuntu 18.04, seems like
> git clone failure will not auto remove this folder. I notice 2.16.2
> and 2.17.0 release note includes this fix. So just wonder to know if
> prior behavior was think of bug, and this fix has change the behavior. 
> 
>  * "git clone $there $here" is allowed even when here directory exists
>    as long as it is an empty directory, but the command incorrectly
>    removed it upon a failure of the operation.

Right, the old behavior was considered a bug. Git didn't create the directory, so when rolling back its changes on failure, it shouldn't delete it either.

-Peff
Previous: Leslie WangNext: Junio C Hamano
Message 2 of 4 in “regarding fix on "git clone $there $here"”
  1. Leslie WangMay 9, 2018
  2. Jeff KingMay 9, 2018
  3. Junio C HamanoMay 9, 2018
  4. Leslie WangMay 9, 2018

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.