diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2014-09-26 15:45:46 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2014-09-26 15:45:46 +0200 |
commit | 9fd1325ecbdfaa41965782166e77d0dc8dd936ec (patch) | |
tree | cc5111673ffa444c1c24ed6bf593855908038a88 /org.eclipse.jgit.test | |
parent | 85b62b4c9ce57e4caa7b10cd770b022bfef24ea9 (diff) | |
parent | 848186da86d624d09cd1518378edff4ad9b7f14f (diff) | |
download | jgit-9fd1325ecbdfaa41965782166e77d0dc8dd936ec.tar.gz jgit-9fd1325ecbdfaa41965782166e77d0dc8dd936ec.zip |
Merge branch 'stable-3.5'
* stable-3.5:
Prepare 3.5.1-SNAPSHOT builds
JGit v3.5.0.201409260305-r
Fix PackWriterBitmapWalker handling non-existing uninteresting objects
Enable maven site generation for jgit
Generate javadocs as part of Maven site project reports
Compare API changes with clirr against 3.4.1
[cli] Use chaining credentials provider to enable .netrc
Add chaining credentials provider
[Java 8] Configure doclint to accept missing descriptions
Do not use .netrc implicitly if no CredentialsProvider was set
Prepare post 3.5.0-rc1 builds
JGit 3.5.0.201409071800-rc1
Fix the ls-remote command when there is no local repo
Change-Id: Iaa4485cac6ff9c7917380e89e12e416e0f52a557
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java index aba48bc35f..873b2cda45 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java @@ -54,6 +54,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.text.ParseException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -225,6 +226,25 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { } /** + * Try to pass non-existing object as uninteresting, with ignoring setting. + * Use a repo with bitmap indexes because then PackWriter will use + * PackWriterBitmapWalker which had problems with this situation. + * + * @throws IOException + * @throws ParseException + */ + @Test + public void testIgnoreNonExistingObjectsWithBitmaps() throws IOException, + ParseException { + final ObjectId nonExisting = ObjectId + .fromString("0000000000000000000000000000000000000001"); + new GC(db).gc(); + createVerifyOpenPack(EMPTY_SET_OBJECT, + Collections.singleton(nonExisting), false, true, true); + // shouldn't throw anything + } + + /** * Create pack basing on only interesting objects, then precisely verify * content. No delta reuse here. * @@ -604,8 +624,17 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { final Set<ObjectId> uninterestings, final boolean thin, final boolean ignoreMissingUninteresting) throws MissingObjectException, IOException { + createVerifyOpenPack(interestings, uninterestings, thin, + ignoreMissingUninteresting, false); + } + + private void createVerifyOpenPack(final Set<ObjectId> interestings, + final Set<ObjectId> uninterestings, final boolean thin, + final boolean ignoreMissingUninteresting, boolean useBitmaps) + throws MissingObjectException, IOException { NullProgressMonitor m = NullProgressMonitor.INSTANCE; writer = new PackWriter(config, db.newObjectReader()); + writer.setUseBitmaps(useBitmaps); writer.setThin(thin); writer.setIgnoreMissingUninteresting(ignoreMissingUninteresting); writer.preparePack(m, interestings, uninterestings); |