From a85979c8b202de5f3044fc673ae05dd333c12128 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Thu, 29 Dec 2016 01:04:25 +0100 Subject: [PATCH] [findBugs] Fix potential NPE in GcPackRefsTest Change-Id: I273c06b9b2ce36c8232803cb7f02d7f846ed49e5 Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java index ea8dfa293..22bec3762 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java @@ -46,6 +46,7 @@ package org.eclipse.jgit.internal.storage.file; import static java.lang.Integer.valueOf; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; @@ -89,7 +90,7 @@ public class GcPackRefsTest extends GcTestCase { tr.branch(ref).commit().create(); String name = repo.findRef(ref).getName(); Path dir = repo.getDirectory().toPath().resolve(name).getParent(); - + assertNotNull(dir); gc.packRefs(); assertFalse(Files.exists(dir)); }