This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 40a63274 authored by Daniel Crazzolara's avatar Daniel Crazzolara
Browse files

Added check before removing directory

parent 2730d8ec
Branches
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -223,7 +223,9 @@ public class GitlabService {
git.commit().setAll(true).setMessage("Importing files").setCommitter(currentUser.getUsername(), currentUser.getEmail()).call();
git.push().setCredentialsProvider(CredentialsProvider.getDefault()).call();
} catch (GitLabApiException | GitAPIException e) {
FileUtils.deleteDirectory(git.getRepository().getDirectory().getParentFile());
if (git.getRepository().getDirectory().getParentFile().exists()) {
FileUtils.deleteDirectory(git.getRepository().getDirectory().getParentFile());
}
log.error("An error occurred during the commit and push of files: {}", e.getMessage());
throw e;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment