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

Re: Git removes existing folder when cancelling clone

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Jan 2, 2018, 11:12 UTC
Message-ID
<alpine.LFD.2.21.1801020610400.14363@localhost.localdomain>
In-Reply-To
<FE0E0877-B77D-4BD6-A513-435C251D920A@you-get.com>
On Tue, 2 Jan 2018, Stephan Janssen wrote:
Show 20 quoted lines
> Hi,
>
> I hope this mailing list is the right way to communicate this.
>
> I just noticed the following behaviour on macOS 10.13.2 running Git v2.15.0:
>
> 1. `mkdir new-folder`
> 2. `ls` - shows new-folder
> 3. `git clone [repo] new-folder`
> 4. Git asks for password
> 5. I cancel by pressing ctrl+c
>
> Result:
> `ls` no longer shows new-folder.
>
> Expected result:
> `ls` shows new-folder
>
> I’m not sure whether this might be a case of ‘works as intended’,
> but it’s not what I’d expect.
  i'm *pretty* sure that the optional directory name you supply is
meant to represent a directory you want git to *create* for you, not
one that already exists. that means the behaviour you see makes sense
-- if git assumes it was supposed to create the directory, and you
cancel the clone, it reasonably assumes it should get rid of it.
  i am willing to be corrected.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Stephan JanssenNext: Jeff King
Message 2 of 16 in “Git removes existing folder when cancelling clone”
  1. Stephan JanssenJan 2, 2018
  2. Robert P. J. DayJan 2, 2018
  3. Jeff KingJan 2, 2018
  4. 0/4 Git removes existing folder when cancelling cloneJeff King, Jan 2, 2018
  5. 1/4 t5600: fix outdated comment about unborn HEADJeff King, Jan 2, 2018
  6. 2/4 t5600: modernize styleJeff King, Jan 2, 2018
  7. 3/4 clone: factor out dir_exists() helperJeff King, Jan 2, 2018
  8. Junio C HamanoJan 4, 2018
  9. Jeff KingJan 4, 2018
  10. Jeff KingJan 5, 2018
  11. Junio C HamanoJan 5, 2018
  12. 4/4 clone: do not clean up directories we didn't createJeff King, Jan 2, 2018
  13. Eric SunshineJan 2, 2018
  14. Jeff KingJan 2, 2018
  15. Junio C HamanoJan 5, 2018
  16. Junio C HamanoJan 4, 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.