Re: [PATCH 4/4] clone: do not clean up directories we didn't create

2018-01-05 Thread Junio C Hamano
Jeff King writes: > Oops. The second one should be "wt" (since the idea was to flip the > logic from the previous). Like so: > > diff --git a/t/t5600-clone-fail-cleanup.sh b/t/t5600-clone-fail-cleanup.sh > index 5cd94d5558..4a1a912e03 100755 > --- a/t/t5600-clone-fail-cleanup.sh > +++ b/t/t5600-c

Re: [PATCH 4/4] clone: do not clean up directories we didn't create

2018-01-04 Thread Junio C Hamano
Jeff King writes: > diff --git a/builtin/clone.c b/builtin/clone.c > index 04b0d7283f..284651797e 100644 > --- a/builtin/clone.c > +++ b/builtin/clone.c > @@ -502,12 +504,12 @@ static void remove_junk(void) > > if (junk_git_dir) { > strbuf_addstr(&sb, junk_git_dir); > -

Re: [PATCH 4/4] clone: do not clean up directories we didn't create

2018-01-02 Thread Jeff King
On Tue, Jan 02, 2018 at 05:49:45PM -0500, Eric Sunshine wrote: > > diff --git a/t/t5600-clone-fail-cleanup.sh b/t/t5600-clone-fail-cleanup.sh > > @@ -42,13 +53,48 @@ test_expect_success 'successful clone must leave the > > directory' ' > > +test_expect_success 'failed clone into empty leaves dire

Re: [PATCH 4/4] clone: do not clean up directories we didn't create

2018-01-02 Thread Eric Sunshine
On Tue, Jan 2, 2018 at 4:11 PM, Jeff King wrote: > [...] > Because we know that the only directory we'll write into is > an empty one, we can handle this case by just passing the > KEEP_TOPLEVEL flag to our recursive delete (if we could > write into populated directories, we'd have to keep track o

[PATCH 4/4] clone: do not clean up directories we didn't create

2018-01-02 Thread Jeff King
Once upon a time, git-clone would refuse to write into a directory that it did not itself create. The cleanup routines for a failed clone could therefore just remove the git and worktree dirs completely. In 55892d2398 (Allow cloning to an existing empty directory, 2009-01-11), we learned to write