Browse Source

[findBugs] Fix potential NPE in GcPackRefsTest

Change-Id: I273c06b9b2ce36c8232803cb7f02d7f846ed49e5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.7
Matthias Sohn 8 years ago
parent
commit
a85979c8b2
  1. 3
      org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java

3
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 java.lang.Integer.valueOf;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame; import static org.junit.Assert.assertSame;
@ -89,7 +90,7 @@ public class GcPackRefsTest extends GcTestCase {
tr.branch(ref).commit().create(); tr.branch(ref).commit().create();
String name = repo.findRef(ref).getName(); String name = repo.findRef(ref).getName();
Path dir = repo.getDirectory().toPath().resolve(name).getParent(); Path dir = repo.getDirectory().toPath().resolve(name).getParent();
assertNotNull(dir);
gc.packRefs(); gc.packRefs();
assertFalse(Files.exists(dir)); assertFalse(Files.exists(dir));
} }

Loading…
Cancel
Save