Browse Source

GC: Simplify expression

Avoid converting path to file to then reconvert it to path.

Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com>
Change-Id: I6a8c3ca9b83bf9b0eead9506938f5d68b27a76f5
stable-4.11
Hector Caballero 7 years ago
parent
commit
6ca4c79063
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java

2
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java

@ -954,7 +954,7 @@ public class GC {
} else { } else {
if (base == null || !n.startsWith(base)) { if (base == null || !n.startsWith(base)) {
try { try {
Files.delete(FileUtils.toPath(new File(packDir.toFile(), n))); Files.delete(packDir.resolve(n));
} catch (IOException e) { } catch (IOException e) {
LOG.error(e.getMessage(), e); LOG.error(e.getMessage(), e);
} }

Loading…
Cancel
Save