}
private void deleteEmptyRefsFolders() throws IOException {
- Path refs = repo.getDirectory().toPath().resolve("refs"); //$NON-NLS-1$
+ Path refs = repo.getDirectory().toPath().resolve(Constants.R_REFS);
try (Stream<Path> entries = Files.list(refs)) {
Iterator<Path> iterator = entries.iterator();
while (iterator.hasNext()) {
return p.toFile().isDirectory();
}
- private boolean delete(Path d) {
+ private void delete(Path d) {
try {
// Avoid deleting a folder that was just created so that concurrent
// operations trying to create a reference are not impacted
// If the folder is not empty, the delete operation will fail
// silently. This is a cheaper alternative to filtering the
// stream in the calling method.
- return d.toFile().delete();
+ Files.delete(d);
}
} catch (IOException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error(MessageFormat.format(JGitText.get().cannotDeleteFile, d),
+ e);
}
- return false;
}
/**