|
|
|
@ -58,7 +58,7 @@ import java.io.File;
|
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.TreeSet; |
|
|
|
|
|
|
|
|
|
import org.eclipse.jgit.lib.Ref.Storage; |
|
|
|
@ -148,17 +148,22 @@ public class RefTest extends SampleDataRepositoryTestCase {
|
|
|
|
|
ObjectId r = db.resolve("refs/remotes/origin/HEAD"); |
|
|
|
|
assertEquals(masterId, r); |
|
|
|
|
|
|
|
|
|
Map<String, Ref> allRefs = db.getAllRefs(); |
|
|
|
|
Ref refHEAD = allRefs.get("refs/remotes/origin/HEAD"); |
|
|
|
|
assertNotNull(refHEAD); |
|
|
|
|
assertEquals(masterId, refHEAD.getObjectId()); |
|
|
|
|
assertFalse(refHEAD.isPeeled()); |
|
|
|
|
assertNull(refHEAD.getPeeledObjectId()); |
|
|
|
|
|
|
|
|
|
Ref refmaster = allRefs.get("refs/remotes/origin/master"); |
|
|
|
|
assertEquals(masterId, refmaster.getObjectId()); |
|
|
|
|
assertFalse(refmaster.isPeeled()); |
|
|
|
|
assertNull(refmaster.getPeeledObjectId()); |
|
|
|
|
List<Ref> allRefs = db.getRefDatabase().getRefs(); |
|
|
|
|
Optional<Ref> refHEAD = allRefs.stream() |
|
|
|
|
.filter(ref -> ref.getName().equals("refs/remotes/origin/HEAD")) |
|
|
|
|
.findAny(); |
|
|
|
|
assertTrue(refHEAD.isPresent()); |
|
|
|
|
assertEquals(masterId, refHEAD.get().getObjectId()); |
|
|
|
|
assertFalse(refHEAD.get().isPeeled()); |
|
|
|
|
assertNull(refHEAD.get().getPeeledObjectId()); |
|
|
|
|
|
|
|
|
|
Optional<Ref> refmaster = allRefs.stream().filter( |
|
|
|
|
ref -> ref.getName().equals("refs/remotes/origin/master")) |
|
|
|
|
.findAny(); |
|
|
|
|
assertTrue(refmaster.isPresent()); |
|
|
|
|
assertEquals(masterId, refmaster.get().getObjectId()); |
|
|
|
|
assertFalse(refmaster.get().isPeeled()); |
|
|
|
|
assertNull(refmaster.get().getPeeledObjectId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|