Delete basedir when clone fails

This commit is contained in:
Patrick Coray
2016-11-03 00:47:40 +01:00
parent d3cdfd35a5
commit 9b51c34d7b

View File

@@ -377,7 +377,13 @@ public class JGitEnvironmentRepository extends AbstractScmEnvironmentRepository
if (hasText(getUsername())) {
setCredentialsProvider(clone);
}
return clone.call();
try {
return clone.call();
}
catch (GitAPIException e) {
deleteBaseDirIfExists();
throw e;
}
}
private void deleteBaseDirIfExists() {