diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-16 11:59:41 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-16 11:59:41 +0900 |
commit | 7929653ff168bcfb896f4dc5bfac07515569517c (patch) | |
tree | c518b45092d958e523e05a3dcc7a50b5990b6367 /org.eclipse.jgit.test | |
parent | 4ac32e79b751944107470d5f4cb290eacd1b7cf9 (diff) | |
parent | 61e4f1665221626cfd31a5826bff527ef7ce5719 (diff) | |
download | jgit-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.java | 12 |
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); + } } } } |