]> source.dussan.org Git - jgit.git/commit
Clean up the disk when cloning fails 65/96565/3
authorThomas Wolf <thomas.wolf@paranor.ch>
Mon, 8 May 2017 06:48:40 +0000 (08:48 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 12 May 2017 09:11:13 +0000 (05:11 -0400)
commit09d96f8d46a31e23fbe5a7b5d8114ae9aaba5056
tree18941cf18db8d56e5f552c22153fd2eedbd06b23
parent3f712aa9805940d3ea1dcafa9f4630d9c901d413
Clean up the disk when cloning fails

CloneCommand.call() has three stages: preparation, then the actual
clone (init/fetch), and finally maybe checking out the working
directory.

Restructure such that if we fail or are cancelled during the actual
clone (middle phase), we do clean up the disk again. This prevents
leaving behind a partial clone in an inconsistent state: either we
have a fully successfully built clone, or nothing at all.

Bug: 516303
Change-Id: I9b18c60f8f99816d42a3deb7d4a33a9f22eeb709
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java