summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-16 11:59:41 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-16 11:59:41 +0900
commit7929653ff168bcfb896f4dc5bfac07515569517c (patch)
treec518b45092d958e523e05a3dcc7a50b5990b6367 /org.eclipse.jgit.test
parent4ac32e79b751944107470d5f4cb290eacd1b7cf9 (diff)
parent61e4f1665221626cfd31a5826bff527ef7ce5719 (diff)
downloadjgit-7929653ff168bcfb896f4dc5bfac07515569517c.tar.gz
jgit-7929653ff168bcfb896f4dc5bfac07515569517c.zip
Merge branch 'stable-4.11'
* stable-4.11: ObjectIdSerializer: Support serialization of known non-null ObjectId Change-Id: Ie430fa2c5d13ae698d884a37d0d03884ebbf25ec Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSerializerTest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSerializerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSerializerTest.java
index 24bc40eee8..d98b792d75 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSerializerTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSerializerTest.java
@@ -79,10 +79,18 @@ public class ObjectIdSerializerTest {
throws Exception {
File file = File.createTempFile("ObjectIdSerializerTest_", "");
try (OutputStream out = new FileOutputStream(file)) {
- ObjectIdSerializer.write(out, objectId);
+ if (objectId == null) {
+ ObjectIdSerializer.write(out, objectId);
+ } else {
+ ObjectIdSerializer.writeWithoutMarker(out, objectId);
+ }
}
try (InputStream in = new FileInputStream(file)) {
- return ObjectIdSerializer.read(in);
+ if (objectId == null) {
+ return ObjectIdSerializer.read(in);
+ } else {
+ return ObjectIdSerializer.readWithoutMarker(in);
+ }
}
}
}