[PATCH 0/4] Git removes existing folder when cancelling clone
- From
Jeff King <peff@peff.net>
- Date
- Jan 2, 2018, 21:07 UTC
- Message-ID
- <20180102210753.GA10430@sigill.intra.peff.net>
- In-Reply-To
- <20180102200443.GA1703@sigill.intra.peff.net>
On Tue, Jan 02, 2018 at 03:04:43PM -0500, Jeff King wrote:
Show 5 quoted lines
> So I don't think there's an urgent data-loss bug here; we will only ever > destroy an empty directory. However, the original intent was to leave > the filesystem as we found it on a failed or aborted clone, and we > obviously don't do that in this case. So it might be nice if we could > restore it to an empty directory.
Here's a patch series to do that. The first three are just preparatory cleanups; the last one is the interesting bit.
[1/4]: t5600: fix outdated comment about unborn HEAD [2/4]: t5600: modernize style [3/4]: clone: factor out dir_exists() helper [4/4]: clone: do not clean up directories we didn't create
builtin/clone.c | 31 ++++++++++--- t/t5600-clone-fail-cleanup.sh | 100 +++++++++++++++++++++++++++++++----------- 2 files changed, 98 insertions(+), 33 deletions(-)
-Peff