summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-08-30 14:45:16 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2024-08-30 14:45:16 +0200
commitd478dd40d55c27da91ffbb9f7e98b9bb11afe629 (patch)
treeb44aa474b05d9c0cf4a3ef2027f42ab7ce24f601 /org.eclipse.jgit.test/tst/org/eclipse/jgit
parentbe33cd40b2dcae1aaee0d9adec9148e5783f2dba (diff)
parent45e28716cbef951301a917f2a4019cc7c8ac041c (diff)
downloadjgit-d478dd40d55c27da91ffbb9f7e98b9bb11afe629.tar.gz
jgit-d478dd40d55c27da91ffbb9f7e98b9bb11afe629.zip
Merge branch 'master' into stable-7.0
* master: walks: Remove deprecated #createReachabilityChecker() method RepoCommand.RemoteReader: Remove @Deprecated method ReachabilityChecker: Remove @Deprecated method UploadPack: Remove @Deprecated classes and methods ObjectId: Add method to read an ObjectId from a ByteBuffer DfsPackFile: re-add metrics for bitmap index loads Change-Id: I383c9784ced95dfd58f01454fd13b086b180d462
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java
index 21032c341f..d6f0b038d2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java
@@ -16,6 +16,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import java.nio.ByteBuffer;
import java.util.Locale;
import org.eclipse.jgit.errors.InvalidObjectIdException;
@@ -153,4 +154,16 @@ public class ObjectIdTest {
assertEquals(ObjectId.fromRaw(exp).name(), id.name());
}
}
+
+ @Test
+ public void test_toFromByteBuffer_raw() {
+ ObjectId oid = ObjectId
+ .fromString("ff00eedd003713bb1bb26b808ec9312548e73946");
+ ByteBuffer anObject = ByteBuffer.allocate(Constants.OBJECT_ID_LENGTH);
+ oid.copyRawTo(anObject);
+ anObject.flip();
+
+ ObjectId actual = ObjectId.fromRaw(anObject);
+ assertEquals(oid.name(), actual.name());
+ }
}