diff --git a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF index 54ac37ce0..d8caa8bae 100644 --- a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF @@ -3,14 +3,14 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ant.test -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: org.apache.tools.ant, - org.eclipse.jgit.ant.tasks;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.junit;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)", + org.eclipse.jgit.ant.tasks;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.junit;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)", org.hamcrest;version="[1.1.0,2.0.0)", org.junit;version="[4.0.0,5.0.0)" diff --git a/org.eclipse.jgit.ant.test/pom.xml b/org.eclipse.jgit.ant.test/pom.xml index f961d55c4..656c6453f 100644 --- a/org.eclipse.jgit.ant.test/pom.xml +++ b/org.eclipse.jgit.ant.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.ant.test diff --git a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF index 3cfb48fb2..cac99f04d 100644 --- a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF @@ -2,11 +2,11 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.ant -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: org.apache.tools.ant, - org.eclipse.jgit.storage.file;version="[3.3.0,3.4.0)" + org.eclipse.jgit.storage.file;version="[3.3.1,3.4.0)" Bundle-Localization: plugin Bundle-Vendor: %Provider-Name -Export-Package: org.eclipse.jgit.ant.tasks;version="3.3.0"; +Export-Package: org.eclipse.jgit.ant.tasks;version="3.3.1"; uses:="org.apache.tools.ant.types,org.apache.tools.ant" diff --git a/org.eclipse.jgit.ant/pom.xml b/org.eclipse.jgit.ant/pom.xml index f31a45770..c65c6cbef 100644 --- a/org.eclipse.jgit.ant/pom.xml +++ b/org.eclipse.jgit.ant/pom.xml @@ -48,7 +48,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.ant diff --git a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF index 34b43c29a..ee4ebc78f 100644 --- a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.archive -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 @@ -12,13 +12,13 @@ Import-Package: org.apache.commons.compress.archivers;version="[1.4,2.0)", org.apache.commons.compress.compressors.bzip2;version="[1.4,2.0)", org.apache.commons.compress.compressors.gzip;version="[1.4,2.0)", org.apache.commons.compress.compressors.xz;version="[1.4,2.0)", - org.eclipse.jgit.api;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", + org.eclipse.jgit.api;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", org.osgi.framework;version="[1.3.0,2.0.0)" Bundle-ActivationPolicy: lazy Bundle-Activator: org.eclipse.jgit.archive.FormatActivator -Export-Package: org.eclipse.jgit.archive;version="3.3.0"; +Export-Package: org.eclipse.jgit.archive;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.api, org.apache.commons.compress.archivers, diff --git a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF index a88916dc5..fdd8cba5d 100644 --- a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.archive - Sources Bundle-SymbolicName: org.eclipse.jgit.archive.source;singleton:=true Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.3.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.archive;version="3.3.0";roots="." +Bundle-Version: 3.3.1.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.archive;version="3.3.1";roots="." diff --git a/org.eclipse.jgit.archive/pom.xml b/org.eclipse.jgit.archive/pom.xml index 1308478c3..5bb74a9af 100644 --- a/org.eclipse.jgit.archive/pom.xml +++ b/org.eclipse.jgit.archive/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.archive diff --git a/org.eclipse.jgit.console/META-INF/MANIFEST.MF b/org.eclipse.jgit.console/META-INF/MANIFEST.MF index 7253f9776..24431ebbc 100644 --- a/org.eclipse.jgit.console/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.console/META-INF/MANIFEST.MF @@ -3,11 +3,11 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.console -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.eclipse.jgit.console;version="3.3.0" -Import-Package: org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)" +Export-Package: org.eclipse.jgit.console;version="3.3.1" +Import-Package: org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)" diff --git a/org.eclipse.jgit.console/pom.xml b/org.eclipse.jgit.console/pom.xml index 8a9cf734c..474bbf293 100644 --- a/org.eclipse.jgit.console/pom.xml +++ b/org.eclipse.jgit.console/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.console diff --git a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF index a7f22cfca..a55001171 100644 --- a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.http.apache -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-Localization: plugin Bundle-Vendor: %Provider-Name @@ -18,10 +18,10 @@ Import-Package: org.apache.http;version="[4.1.0,5.0.0)", org.apache.http.impl.client;version="[4.1.0,5.0.0)", org.apache.http.impl.client.cache;version="[4.1.0,5.0.0)", org.apache.http.params;version="[4.1.0,5.0.0)", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.http;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)" -Export-Package: org.eclipse.jgit.transport.http.apache;version="3.3.0"; + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.http;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)" +Export-Package: org.eclipse.jgit.transport.http.apache;version="3.3.1"; uses:="org.eclipse.jgit.transport.http, javax.net.ssl, org.apache.http.client, diff --git a/org.eclipse.jgit.http.apache/pom.xml b/org.eclipse.jgit.http.apache/pom.xml index c184da746..5fc66f68a 100644 --- a/org.eclipse.jgit.http.apache/pom.xml +++ b/org.eclipse.jgit.http.apache/pom.xml @@ -48,7 +48,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.http.apache diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF index a9b1fbb86..5b0e37080 100644 --- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF @@ -2,14 +2,14 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.server -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Export-Package: - org.eclipse.jgit.http.server;version="3.3.0", - org.eclipse.jgit.http.server.glue;version="3.3.0"; + org.eclipse.jgit.http.server;version="3.3.1", + org.eclipse.jgit.http.server.glue;version="3.3.1"; uses:="javax.servlet,javax.servlet.http", - org.eclipse.jgit.http.server.resolver;version="3.3.0"; + org.eclipse.jgit.http.server.resolver;version="3.3.1"; uses:="org.eclipse.jgit.transport.resolver, org.eclipse.jgit.lib, org.eclipse.jgit.transport, @@ -18,11 +18,11 @@ Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: javax.servlet;version="[2.5.0,3.0.0)", javax.servlet.http;version="[2.5.0,3.0.0)", - org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.resolver;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)" + org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.resolver;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)" diff --git a/org.eclipse.jgit.http.server/pom.xml b/org.eclipse.jgit.http.server/pom.xml index 8e14ce5cf..24d79bc4d 100644 --- a/org.eclipse.jgit.http.server/pom.xml +++ b/org.eclipse.jgit.http.server/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.http.server diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF index 4bc2e7459..a12c97189 100644 --- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.test -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 @@ -22,23 +22,23 @@ Import-Package: javax.servlet;version="[2.5.0,3.0.0)", org.eclipse.jetty.util.log;version="[7.6.0,8.0.0)", org.eclipse.jetty.util.security;version="[7.6.0,8.0.0)", org.eclipse.jetty.util.thread;version="[7.6.0,8.0.0)", - org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.http.server;version="[3.3.0,3.4.0)", - org.eclipse.jgit.http.server.glue;version="[3.3.0,3.4.0)", - org.eclipse.jgit.http.server.resolver;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.junit;version="[3.3.0,3.4.0)", - org.eclipse.jgit.junit.http;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.http;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.http.apache;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.resolver;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)", + org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.http.server;version="[3.3.1,3.4.0)", + org.eclipse.jgit.http.server.glue;version="[3.3.1,3.4.0)", + org.eclipse.jgit.http.server.resolver;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.junit;version="[3.3.1,3.4.0)", + org.eclipse.jgit.junit.http;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.http;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.http.apache;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.resolver;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)", org.hamcrest.core;version="[1.1.0,2.0.0)", org.junit;version="[4.0.0,5.0.0)", org.junit.runner;version="[4.0.0,5.0.0)", diff --git a/org.eclipse.jgit.http.test/pom.xml b/org.eclipse.jgit.http.test/pom.xml index 3ceac222f..5328dbe9d 100644 --- a/org.eclipse.jgit.http.test/pom.xml +++ b/org.eclipse.jgit.http.test/pom.xml @@ -51,7 +51,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.http.test diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java new file mode 100644 index 000000000..108e7bb72 --- /dev/null +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2014, Matthias Sohn + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.http.test; + +import static org.junit.Assert.assertEquals; + +import java.util.Collection; +import java.util.Collections; + +import javax.servlet.http.HttpServletRequest; + +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jgit.errors.RepositoryNotFoundException; +import org.eclipse.jgit.http.server.GitServlet; +import org.eclipse.jgit.http.server.resolver.DefaultReceivePackFactory; +import org.eclipse.jgit.junit.TestRepository; +import org.eclipse.jgit.junit.http.HttpTestCase; +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.NullProgressMonitor; +import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; +import org.eclipse.jgit.revwalk.RevBlob; +import org.eclipse.jgit.revwalk.RevCommit; +import org.eclipse.jgit.transport.PostReceiveHook; +import org.eclipse.jgit.transport.PushResult; +import org.eclipse.jgit.transport.ReceiveCommand; +import org.eclipse.jgit.transport.ReceivePack; +import org.eclipse.jgit.transport.RemoteRefUpdate; +import org.eclipse.jgit.transport.Transport; +import org.eclipse.jgit.transport.URIish; +import org.eclipse.jgit.transport.resolver.RepositoryResolver; +import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; +import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; +import org.junit.Before; +import org.junit.Test; + +public class MeasurePackSizeTest extends HttpTestCase { + private Repository remoteRepository; + + private URIish remoteURI; + + long packSize = -1; + + @Before + public void setUp() throws Exception { + super.setUp(); + + final TestRepository src = createTestRepository(); + final String srcName = src.getRepository().getDirectory().getName(); + + ServletContextHandler app = server.addContext("/git"); + GitServlet gs = new GitServlet(); + gs.setRepositoryResolver(new RepositoryResolver() { + public Repository open(HttpServletRequest req, String name) + throws RepositoryNotFoundException, + ServiceNotEnabledException { + if (!name.equals(srcName)) + throw new RepositoryNotFoundException(name); + + final Repository db = src.getRepository(); + db.incrementOpen(); + return db; + } + }); + gs.setReceivePackFactory(new DefaultReceivePackFactory() { + public ReceivePack create(HttpServletRequest req, Repository db) + throws ServiceNotEnabledException, + ServiceNotAuthorizedException { + ReceivePack recv = super.create(req, db); + recv.setPostReceiveHook(new PostReceiveHook() { + + public void onPostReceive(ReceivePack rp, + Collection commands) { + packSize = rp.getPackSize(); + } + }); + return recv; + } + + }); + app.addServlet(new ServletHolder(gs), "/*"); + + server.setUp(); + + remoteRepository = src.getRepository(); + remoteURI = toURIish(app, srcName); + + StoredConfig cfg = remoteRepository.getConfig(); + cfg.setBoolean("http", null, "receivepack", true); + cfg.save(); + } + + @Test + public void testPush_packSize() throws Exception { + final TestRepository src = createTestRepository(); + final RevBlob Q_txt = src + .blob("some blob content to measure pack size"); + final RevCommit Q = src.commit().add("Q", Q_txt).create(); + final Repository db = src.getRepository(); + final String dstName = Constants.R_HEADS + "new.branch"; + Transport t; + PushResult result; + + t = Transport.open(db, remoteURI); + try { + final String srcExpr = Q.name(); + final boolean forceUpdate = false; + final String localName = null; + final ObjectId oldId = null; + + RemoteRefUpdate update = new RemoteRefUpdate(src.getRepository(), + srcExpr, dstName, forceUpdate, localName, oldId); + result = t.push(NullProgressMonitor.INSTANCE, + Collections.singleton(update)); + } finally { + t.close(); + } + assertEquals("expected 1 RemoteUpdate", 1, result.getRemoteUpdates() + .size()); + assertEquals("unexpected pack size", 1398, packSize); + } + +} diff --git a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF index 7c4a127a9..eeabe10b6 100644 --- a/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF @@ -2,17 +2,17 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.java7.test -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: org.eclipse.jgit.api;version="[3.3.0,3.4.0)", - org.eclipse.jgit.diff;version="[3.3.0,3.4.0)", - org.eclipse.jgit.dircache;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="3.3.0", - org.eclipse.jgit.junit;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)", +Import-Package: org.eclipse.jgit.api;version="[3.3.1,3.4.0)", + org.eclipse.jgit.diff;version="[3.3.1,3.4.0)", + org.eclipse.jgit.dircache;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="3.3.1", + org.eclipse.jgit.junit;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)", org.junit;version="[4.11.0,5.0.0)" diff --git a/org.eclipse.jgit.java7.test/org.eclipse.jgit.java7 -- Java7 feature test.launch b/org.eclipse.jgit.java7.test/org.eclipse.jgit.java7 -- Java7 feature test.launch new file mode 100644 index 000000000..d65d045d9 --- /dev/null +++ b/org.eclipse.jgit.java7.test/org.eclipse.jgit.java7 -- Java7 feature test.launch @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.jgit.java7.test/pom.xml b/org.eclipse.jgit.java7.test/pom.xml index c7a045b52..a3da38f27 100644 --- a/org.eclipse.jgit.java7.test/pom.xml +++ b/org.eclipse.jgit.java7.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.java7.test diff --git a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java index 484467b24..2b2d65e9b 100644 --- a/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java +++ b/org.eclipse.jgit.java7.test/src/org/eclipse/jgit/treewalk/FileTreeIteratorJava7Test.java @@ -114,7 +114,8 @@ public void apply(DirCacheEntry ent) { assertEquals("link", dci.getEntryPathString()); // test - assertFalse(fti.isModified(dci.getDirCacheEntry(), true)); + assertFalse(fti.isModified(dci.getDirCacheEntry(), true, + db.newObjectReader())); } /** @@ -195,6 +196,7 @@ public void apply(DirCacheEntry ent) { assertEquals("link", dci.getEntryPathString()); // test - assertTrue(fti.isModified(dci.getDirCacheEntry(), true)); + assertTrue(fti.isModified(dci.getDirCacheEntry(), true, + db.newObjectReader())); } } diff --git a/org.eclipse.jgit.java7/META-INF/MANIFEST.MF b/org.eclipse.jgit.java7/META-INF/MANIFEST.MF index bdb3db04d..732021f82 100644 --- a/org.eclipse.jgit.java7/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.java7/META-INF/MANIFEST.MF @@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2 Fragment-Host: org.eclipse.jgit;bundle-version="3.1.1" Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.java7 -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.eclipse.jgit.util;version="3.3.0" +Export-Package: org.eclipse.jgit.util;version="3.3.1" diff --git a/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF index 0a28928d3..852d92a03 100644 --- a/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.java7/META-INF/SOURCE-MANIFEST.MF @@ -3,6 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.java7 - Sources Bundle-SymbolicName: org.eclipse.jgit.java7.source;singleton:=true Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.3.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.java7;version="3.3.0";roots="." +Bundle-Version: 3.3.1.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.java7;version="3.3.1";roots="." diff --git a/org.eclipse.jgit.java7/pom.xml b/org.eclipse.jgit.java7/pom.xml index 1c5c9d7cb..42df18d3f 100644 --- a/org.eclipse.jgit.java7/pom.xml +++ b/org.eclipse.jgit.java7/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.java7 diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF index 61058ed14..22fd07dad 100644 --- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit.http -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy @@ -20,13 +20,13 @@ Import-Package: javax.servlet;version="[2.5.0,3.0.0)", org.eclipse.jetty.util.component;version="[7.6.0,8.0.0)", org.eclipse.jetty.util.log;version="[7.6.0,8.0.0)", org.eclipse.jetty.util.security;version="[7.6.0,8.0.0)", - org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.http.server;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.junit;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.resolver;version="[3.3.0,3.4.0)", + org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.http.server;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.junit;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.resolver;version="[3.3.1,3.4.0)", org.junit;version="[4.0.0,5.0.0)" -Export-Package: org.eclipse.jgit.junit.http;version="3.3.0" +Export-Package: org.eclipse.jgit.junit.http;version="3.3.1" diff --git a/org.eclipse.jgit.junit.http/pom.xml b/org.eclipse.jgit.junit.http/pom.xml index e103e46d7..dc91e34fd 100644 --- a/org.eclipse.jgit.junit.http/pom.xml +++ b/org.eclipse.jgit.junit.http/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.junit.http diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF index c1a996cfd..7679630e0 100644 --- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF @@ -2,23 +2,23 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Import-Package: org.eclipse.jgit.api;version="[3.3.0,3.4.0)", - org.eclipse.jgit.api.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.dircache;version="[3.3.0,3.4.0)", - org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.pack;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk.filter;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util.io;version="[3.3.0,3.4.0)", +Import-Package: org.eclipse.jgit.api;version="[3.3.1,3.4.0)", + org.eclipse.jgit.api.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.dircache;version="[3.3.1,3.4.0)", + org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.pack;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk.filter;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util.io;version="[3.3.1,3.4.0)", org.junit;version="[4.0.0,5.0.0)" -Export-Package: org.eclipse.jgit.junit;version="3.3.0" +Export-Package: org.eclipse.jgit.junit;version="3.3.1" diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml index 3e084e3b4..953ad2890 100644 --- a/org.eclipse.jgit.junit/pom.xml +++ b/org.eclipse.jgit.junit/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.junit diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml index 443fffe07..ea908c386 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml @@ -2,7 +2,7 @@ @@ -57,18 +57,4 @@ version="0.0.0" unpack="false"/> - - - - diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml index 564fb76d8..12148d4a9 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml index 05ee92479..01d7ff093 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml @@ -2,7 +2,7 @@ @@ -33,4 +33,18 @@ version="0.0.0" unpack="false"/> + + + + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml index fcc120c7f..4c1a5adfa 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml index c9261ec3b..df749ac67 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml index 75c881e33..191c8b962 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.java7.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml index 6877a5f24..073bac03f 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml index 29c74b393..1a42a1025 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml index 3c6c31082..869382df6 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml @@ -2,7 +2,7 @@ @@ -27,7 +27,7 @@ version="0.0.0"/> - + org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml index d7ba5e9b8..814f93304 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml index 4477fe8df..c26869213 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml index c3f16c283..b3e876f47 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.repository diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml index 32928663d..c2fed9981 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml index 77532bb5f..ff2c333b7 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.feature diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF index 82e7870c4..80df938ef 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF @@ -2,4 +2,4 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: JGit Target Platform Bundle Bundle-SymbolicName: org.eclipse.jgit.target -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml index 89cbf7b76..a185d9e6b 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml @@ -49,7 +49,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.target diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml index e6ce495bd..c3b6ea4a6 100644 --- a/org.eclipse.jgit.packaging/pom.xml +++ b/org.eclipse.jgit.packaging/pom.xml @@ -53,7 +53,7 @@ org.eclipse.jgit jgit.tycho.parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT pom JGit Tycho Parent diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF index 403c2f463..24e7f29e0 100644 --- a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF @@ -2,25 +2,25 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm.test -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Import-Package: org.eclipse.jgit.api;version="[3.3.0,3.4.0)", - org.eclipse.jgit.dircache;version="[3.3.0,3.4.0)", - org.eclipse.jgit.junit;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.merge;version="[3.3.0,3.4.0)", - org.eclipse.jgit.pgm;version="[3.3.0,3.4.0)", - org.eclipse.jgit.pgm.internal;version="[3.3.0,3.4.0)", - org.eclipse.jgit.pgm.opt;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util.io;version="[3.3.0,3.4.0)", +Import-Package: org.eclipse.jgit.api;version="[3.3.1,3.4.0)", + org.eclipse.jgit.dircache;version="[3.3.1,3.4.0)", + org.eclipse.jgit.junit;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.merge;version="[3.3.1,3.4.0)", + org.eclipse.jgit.pgm;version="[3.3.1,3.4.0)", + org.eclipse.jgit.pgm.internal;version="[3.3.1,3.4.0)", + org.eclipse.jgit.pgm.opt;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util.io;version="[3.3.1,3.4.0)", org.hamcrest.core;bundle-version="[1.1.0,2.0.0)", org.junit;version="[4.4.0,5.0.0)", org.kohsuke.args4j;version="[2.0.12,2.1.0)" diff --git a/org.eclipse.jgit.pgm.test/pom.xml b/org.eclipse.jgit.pgm.test/pom.xml index 1d88edf15..490b80f5c 100644 --- a/org.eclipse.jgit.pgm.test/pom.xml +++ b/org.eclipse.jgit.pgm.test/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.pgm.test diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF index b4b0766a5..f70e5d9c1 100644 --- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF @@ -2,42 +2,42 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: org.apache.commons.compress.archivers;version="[1.3,2.0)", org.apache.commons.compress.archivers.tar;version="[1.3,2.0)", org.apache.commons.compress.archivers.zip;version="[1.3,2.0)", - org.eclipse.jgit.api;version="[3.3.0,3.4.0)", - org.eclipse.jgit.api.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.archive;version="[3.3.0,3.4.0)", - org.eclipse.jgit.awtui;version="[3.3.0,3.4.0)", - org.eclipse.jgit.blame;version="[3.3.0,3.4.0)", - org.eclipse.jgit.diff;version="[3.3.0,3.4.0)", - org.eclipse.jgit.dircache;version="[3.3.0,3.4.0)", - org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.pack;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.merge;version="3.3.0", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", - org.eclipse.jgit.notes;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revplot;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk.filter;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.pack;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.resolver;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk.filter;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util.io;version="[3.3.0,3.4.0)", + org.eclipse.jgit.api;version="[3.3.1,3.4.0)", + org.eclipse.jgit.api.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.archive;version="[3.3.1,3.4.0)", + org.eclipse.jgit.awtui;version="[3.3.1,3.4.0)", + org.eclipse.jgit.blame;version="[3.3.1,3.4.0)", + org.eclipse.jgit.diff;version="[3.3.1,3.4.0)", + org.eclipse.jgit.dircache;version="[3.3.1,3.4.0)", + org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.pack;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.merge;version="3.3.1", + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", + org.eclipse.jgit.notes;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revplot;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk.filter;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.pack;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.resolver;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk.filter;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util.io;version="[3.3.1,3.4.0)", org.kohsuke.args4j;version="[2.0.12,2.1.0)", org.kohsuke.args4j.spi;version="[2.0.12,2.1.0)" Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.jgit.pgm;version="3.3.0"; +Export-Package: org.eclipse.jgit.pgm;version="3.3.1"; uses:="org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.pgm.opt, @@ -48,10 +48,10 @@ Export-Package: org.eclipse.jgit.pgm;version="3.3.0"; org.eclipse.jgit.treewalk, javax.swing, org.eclipse.jgit.transport", - org.eclipse.jgit.pgm.debug;version="3.3.0"; + org.eclipse.jgit.pgm.debug;version="3.3.1"; uses:="org.eclipse.jgit.pgm", - org.eclipse.jgit.pgm.internal;version="3.3.0";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test", - org.eclipse.jgit.pgm.opt;version="3.3.0"; + org.eclipse.jgit.pgm.internal;version="3.3.1";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test", + org.eclipse.jgit.pgm.opt;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.kohsuke.args4j.spi, diff --git a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF index 12814d986..3f7164197 100644 --- a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit.pgm - Sources Bundle-SymbolicName: org.eclipse.jgit.pgm.source;singleton:=true Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.3.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="3.3.0";roots="." +Bundle-Version: 3.3.1.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="3.3.1";roots="." diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml index f216a9daf..ee287d666 100644 --- a/org.eclipse.jgit.pgm/pom.xml +++ b/org.eclipse.jgit.pgm/pom.xml @@ -50,7 +50,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.pgm diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF index 545318424..3f2f6ca01 100644 --- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF @@ -2,47 +2,47 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.test -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Import-Package: com.googlecode.javaewah;version="[0.7.9,0.8.0)", - org.eclipse.jgit.api;version="[3.3.0,3.4.0)", - org.eclipse.jgit.api.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.awtui;version="[3.3.0,3.4.0)", - org.eclipse.jgit.blame;version="[3.3.0,3.4.0)", - org.eclipse.jgit.console;version="[3.3.0,3.4.0)", - org.eclipse.jgit.diff;version="[3.3.0,3.4.0)", - org.eclipse.jgit.dircache;version="[3.3.0,3.4.0)", - org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.events;version="[3.3.0,3.4.0)", - org.eclipse.jgit.fnmatch;version="[3.3.0,3.4.0)", - org.eclipse.jgit.ignore;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.dfs;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.internal.storage.pack;version="[3.3.0,3.4.0)", - org.eclipse.jgit.junit;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.merge;version="[3.3.0,3.4.0)", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", - org.eclipse.jgit.notes;version="[3.3.0,3.4.0)", - org.eclipse.jgit.patch;version="[3.3.0,3.4.0)", - org.eclipse.jgit.pgm;version="[3.3.0,3.4.0)", - org.eclipse.jgit.pgm.internal;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revplot;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk.filter;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.file;version="[3.3.0,3.4.0)", - org.eclipse.jgit.storage.pack;version="[3.3.0,3.4.0)", - org.eclipse.jgit.submodule;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport.http;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.treewalk.filter;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util.io;version="[3.3.0,3.4.0)", + org.eclipse.jgit.api;version="[3.3.1,3.4.0)", + org.eclipse.jgit.api.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.awtui;version="[3.3.1,3.4.0)", + org.eclipse.jgit.blame;version="[3.3.1,3.4.0)", + org.eclipse.jgit.console;version="[3.3.1,3.4.0)", + org.eclipse.jgit.diff;version="[3.3.1,3.4.0)", + org.eclipse.jgit.dircache;version="[3.3.1,3.4.0)", + org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.events;version="[3.3.1,3.4.0)", + org.eclipse.jgit.fnmatch;version="[3.3.1,3.4.0)", + org.eclipse.jgit.ignore;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.dfs;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.internal.storage.pack;version="[3.3.1,3.4.0)", + org.eclipse.jgit.junit;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.merge;version="[3.3.1,3.4.0)", + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", + org.eclipse.jgit.notes;version="[3.3.1,3.4.0)", + org.eclipse.jgit.patch;version="[3.3.1,3.4.0)", + org.eclipse.jgit.pgm;version="[3.3.1,3.4.0)", + org.eclipse.jgit.pgm.internal;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revplot;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk.filter;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.file;version="[3.3.1,3.4.0)", + org.eclipse.jgit.storage.pack;version="[3.3.1,3.4.0)", + org.eclipse.jgit.submodule;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport.http;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.treewalk.filter;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util.io;version="[3.3.1,3.4.0)", org.hamcrest;version="[1.1.0,2.0.0)", org.junit;version="[4.4.0,5.0.0)", org.junit.experimental.theories;version="[4.4.0,5.0.0)", diff --git a/org.eclipse.jgit.test/pom.xml b/org.eclipse.jgit.test/pom.xml index 55d546b25..29a87e9fd 100644 --- a/org.eclipse.jgit.test/pom.xml +++ b/org.eclipse.jgit.test/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.test diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/ResolveMergerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/ResolveMergerTest.java index 54de8cfb4..dd06168c3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/ResolveMergerTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/ResolveMergerTest.java @@ -53,6 +53,7 @@ import org.eclipse.jgit.api.MergeResult; import org.eclipse.jgit.api.MergeResult.MergeStatus; import org.eclipse.jgit.api.errors.CheckoutConflictException; +import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.errors.NoMergeBaseException; @@ -264,6 +265,37 @@ public void checkUntrackedEmpytFolderIsNotAConflictWithFile( indexState(CONTENT)); } + @Theory + public void mergeWithCrlfInWT(MergeStrategy strategy) throws IOException, + GitAPIException { + Git git = Git.wrap(db); + db.getConfig().setString("core", null, "autocrlf", "false"); + db.getConfig().save(); + writeTrashFile("crlf.txt", "some\r\ndata\r\n"); + git.add().addFilepattern("crlf.txt").call(); + git.commit().setMessage("base").call(); + + git.branchCreate().setName("brancha").call(); + + writeTrashFile("crlf.txt", "some\r\nmore\r\ndata\r\n"); + git.add().addFilepattern("crlf.txt").call(); + git.commit().setMessage("on master").call(); + + git.checkout().setName("brancha").call(); + writeTrashFile("crlf.txt", "some\r\ndata\r\ntoo\r\n"); + git.add().addFilepattern("crlf.txt").call(); + git.commit().setMessage("on brancha").call(); + + db.getConfig().setString("core", null, "autocrlf", "input"); + db.getConfig().save(); + + MergeResult mergeResult = git.merge().setStrategy(strategy) + .include(db.resolve("master")) + .call(); + assertEquals(MergeResult.MergeStatus.MERGED, + mergeResult.getMergeStatus()); + } + /** * Merging two equal subtrees when the index does not contain any file in * that subtree should lead to a merged state. diff --git a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF index 9092c8296..7c83babbd 100644 --- a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF @@ -3,14 +3,14 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ui -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Vendor: %provider_name Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.jgit.awtui;version="3.3.0" -Import-Package: org.eclipse.jgit.errors;version="[3.3.0,3.4.0)", - org.eclipse.jgit.lib;version="[3.3.0,3.4.0)", - org.eclipse.jgit.nls;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revplot;version="[3.3.0,3.4.0)", - org.eclipse.jgit.revwalk;version="[3.3.0,3.4.0)", - org.eclipse.jgit.transport;version="[3.3.0,3.4.0)", - org.eclipse.jgit.util;version="[3.3.0,3.4.0)" +Export-Package: org.eclipse.jgit.awtui;version="3.3.1" +Import-Package: org.eclipse.jgit.errors;version="[3.3.1,3.4.0)", + org.eclipse.jgit.lib;version="[3.3.1,3.4.0)", + org.eclipse.jgit.nls;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revplot;version="[3.3.1,3.4.0)", + org.eclipse.jgit.revwalk;version="[3.3.1,3.4.0)", + org.eclipse.jgit.transport;version="[3.3.1,3.4.0)", + org.eclipse.jgit.util;version="[3.3.1,3.4.0)" diff --git a/org.eclipse.jgit.ui/pom.xml b/org.eclipse.jgit.ui/pom.xml index 29db00fb0..8a6b452de 100644 --- a/org.eclipse.jgit.ui/pom.xml +++ b/org.eclipse.jgit.ui/pom.xml @@ -52,7 +52,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit.ui diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF index 2b0598051..1946db81a 100644 --- a/org.eclipse.jgit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/MANIFEST.MF @@ -2,10 +2,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name -Export-Package: org.eclipse.jgit.api;version="3.3.0"; +Export-Package: org.eclipse.jgit.api;version="3.3.1"; uses:="org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.diff, @@ -18,45 +18,45 @@ Export-Package: org.eclipse.jgit.api;version="3.3.0"; org.eclipse.jgit.blame, org.eclipse.jgit.transport, org.eclipse.jgit.merge", - org.eclipse.jgit.api.errors;version="3.3.0"; + org.eclipse.jgit.api.errors;version="3.3.1"; uses:="org.eclipse.jgit.lib,org.eclipse.jgit.errors", - org.eclipse.jgit.blame;version="3.3.0"; + org.eclipse.jgit.blame;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.diff", - org.eclipse.jgit.diff;version="3.3.0"; + org.eclipse.jgit.diff;version="3.3.1"; uses:="org.eclipse.jgit.patch, org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.util", - org.eclipse.jgit.dircache;version="3.3.0"; + org.eclipse.jgit.dircache;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.util, org.eclipse.jgit.events", - org.eclipse.jgit.errors;version="3.3.0"; + org.eclipse.jgit.errors;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.internal.storage.pack, org.eclipse.jgit.transport, org.eclipse.jgit.dircache", - org.eclipse.jgit.events;version="3.3.0"; + org.eclipse.jgit.events;version="3.3.1"; uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.fnmatch;version="3.3.0", - org.eclipse.jgit.ignore;version="3.3.0", - org.eclipse.jgit.internal;version="3.3.0";x-friends:="org.eclipse.jgit.test,org.eclipse.jgit.http.test", - org.eclipse.jgit.internal.storage.dfs;version="3.3.0";x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal.storage.file;version="3.3.0"; + org.eclipse.jgit.fnmatch;version="3.3.1", + org.eclipse.jgit.ignore;version="3.3.1", + org.eclipse.jgit.internal;version="3.3.1";x-friends:="org.eclipse.jgit.test,org.eclipse.jgit.http.test", + org.eclipse.jgit.internal.storage.dfs;version="3.3.1";x-friends:="org.eclipse.jgit.test", + org.eclipse.jgit.internal.storage.file;version="3.3.1"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.junit, org.eclipse.jgit.junit.http, org.eclipse.jgit.http.server, org.eclipse.jgit.java7.test, org.eclipse.jgit.pgm", - org.eclipse.jgit.internal.storage.pack;version="3.3.0";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", - org.eclipse.jgit.lib;version="3.3.0"; + org.eclipse.jgit.internal.storage.pack;version="3.3.1";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", + org.eclipse.jgit.lib;version="3.3.1"; uses:="org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.util, @@ -65,37 +65,37 @@ Export-Package: org.eclipse.jgit.api;version="3.3.0"; org.eclipse.jgit.internal.storage.file, org.eclipse.jgit.treewalk, org.eclipse.jgit.transport", - org.eclipse.jgit.merge;version="3.3.0"; + org.eclipse.jgit.merge;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.revwalk, org.eclipse.jgit.diff, org.eclipse.jgit.dircache", - org.eclipse.jgit.nls;version="3.3.0", - org.eclipse.jgit.notes;version="3.3.0"; + org.eclipse.jgit.nls;version="3.3.1", + org.eclipse.jgit.notes;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.revwalk, org.eclipse.jgit.merge", - org.eclipse.jgit.patch;version="3.3.0"; + org.eclipse.jgit.patch;version="3.3.1"; uses:="org.eclipse.jgit.lib,org.eclipse.jgit.diff", - org.eclipse.jgit.revplot;version="3.3.0"; + org.eclipse.jgit.revplot;version="3.3.1"; uses:="org.eclipse.jgit.lib,org.eclipse.jgit.revwalk", - org.eclipse.jgit.revwalk;version="3.3.0"; + org.eclipse.jgit.revwalk;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.diff, org.eclipse.jgit.revwalk.filter", - org.eclipse.jgit.revwalk.filter;version="3.3.0"; + org.eclipse.jgit.revwalk.filter;version="3.3.1"; uses:="org.eclipse.jgit.revwalk,org.eclipse.jgit.util", - org.eclipse.jgit.storage.file;version="3.3.0"; + org.eclipse.jgit.storage.file;version="3.3.1"; uses:="org.eclipse.jgit.lib,org.eclipse.jgit.util", - org.eclipse.jgit.storage.pack;version="3.3.0"; + org.eclipse.jgit.storage.pack;version="3.3.1"; uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.submodule;version="3.3.0"; + org.eclipse.jgit.submodule;version="3.3.1"; uses:="org.eclipse.jgit.lib,org.eclipse.jgit.treewalk,org.eclipse.jgit.treewalk.filter", - org.eclipse.jgit.transport;version="3.3.0"; + org.eclipse.jgit.transport;version="3.3.1"; uses:="org.eclipse.jgit.transport.resolver, org.eclipse.jgit.revwalk, org.eclipse.jgit.internal.storage.pack, @@ -107,21 +107,21 @@ Export-Package: org.eclipse.jgit.api;version="3.3.0"; org.eclipse.jgit.transport.http, org.eclipse.jgit.errors, org.eclipse.jgit.storage.pack", - org.eclipse.jgit.transport.http;version="3.3.0"; + org.eclipse.jgit.transport.http;version="3.3.1"; uses:="javax.net.ssl", - org.eclipse.jgit.transport.resolver;version="3.3.0"; + org.eclipse.jgit.transport.resolver;version="3.3.1"; uses:="org.eclipse.jgit.lib,org.eclipse.jgit.transport", - org.eclipse.jgit.treewalk;version="3.3.0"; + org.eclipse.jgit.treewalk;version="3.3.1"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.util, org.eclipse.jgit.dircache", - org.eclipse.jgit.treewalk.filter;version="3.3.0"; + org.eclipse.jgit.treewalk.filter;version="3.3.1"; uses:="org.eclipse.jgit.treewalk", - org.eclipse.jgit.util;version="3.3.0"; + org.eclipse.jgit.util;version="3.3.1"; uses:="org.eclipse.jgit.lib,org.eclipse.jgit.transport.http,org.eclipse.jgit.storage.file", - org.eclipse.jgit.util.io;version="3.3.0" + org.eclipse.jgit.util.io;version="3.3.1" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Require-Bundle: com.jcraft.jsch;bundle-version="[0.1.37,0.2.0)" diff --git a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF index d79a190ae..d4e6c2853 100644 --- a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF @@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2 Bundle-Name: org.eclipse.jgit - Sources Bundle-SymbolicName: org.eclipse.jgit.source;singleton:=true Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 3.3.0.qualifier -Eclipse-SourceBundle: org.eclipse.jgit;version="3.3.0";roots="." +Bundle-Version: 3.3.1.qualifier +Eclipse-SourceBundle: org.eclipse.jgit;version="3.3.1";roots="." diff --git a/org.eclipse.jgit/pom.xml b/org.eclipse.jgit/pom.xml index c3f681e9c..43043f971 100644 --- a/org.eclipse.jgit/pom.xml +++ b/org.eclipse.jgit/pom.xml @@ -53,7 +53,7 @@ org.eclipse.jgit org.eclipse.jgit-parent - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT org.eclipse.jgit diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index bb67c127a..57c08f369 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -378,6 +378,7 @@ packHasUnresolvedDeltas=pack has unresolved deltas packingCancelledDuringObjectsWriting=Packing cancelled during objects writing packObjectCountMismatch=Pack object count mismatch: pack {0} index {1}: {2} packRefs=Pack refs +packSizeNotSetYet=Pack size not yet set since it has not yet been received packTooLargeForIndexVersion1=Pack too large for index version 1 packWriterStatistics=Total {0,number,#0} (delta {1,number,#0}), reused {2,number,#0} (delta {3,number,#0}) panicCantRenameIndexFile=Panic: index file {0} must be renamed to replace {1}; until then repository is corrupt @@ -403,6 +404,8 @@ readingObjectsFromLocalRepositoryFailed=reading objects from local repository fa readTimedOut=Read timed out after {0} ms receivePackObjectTooLarge1=Object too large, rejecting the pack. Max object size limit is {0} bytes. receivePackObjectTooLarge2=Object too large ({0} bytes), rejecting the pack. Max object size limit is {1} bytes. +receivePackInvalidLimit=Illegal limit parameter value {0} +receivePackTooLarge=Pack exceeds the limit of {0} bytes, rejecting the pack receivingObjects=Receiving objects refAlreadyExists=already exists refAlreadyExists1=Ref {0} already exists diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/TooLargePackException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/TooLargePackException.java new file mode 100644 index 000000000..5cf0f802c --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/TooLargePackException.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2014, Sasa Zivkov , SAP AG + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.eclipse.jgit.errors; + +import java.io.IOException; +import java.text.MessageFormat; + +import org.eclipse.jgit.internal.JGitText; + +/** + * Thrown when a pack exceeds a given size limit + * + * @since 3.3 + */ +public class TooLargePackException extends IOException { + private static final long serialVersionUID = 1L; + + /** + * Construct a too large pack exception. + * + * @param packSizeLimit + * the pack size limit (in bytes) that was exceeded + */ + public TooLargePackException(long packSizeLimit) { + super(MessageFormat.format(JGitText.get().receivePackTooLarge, + Long.valueOf(packSizeLimit))); + } +} diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index f9700a1ff..40e74ed89 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -440,6 +440,7 @@ public static JGitText get() { /***/ public String packingCancelledDuringObjectsWriting; /***/ public String packObjectCountMismatch; /***/ public String packRefs; + /***/ public String packSizeNotSetYet; /***/ public String packTooLargeForIndexVersion1; /***/ public String packWriterStatistics; /***/ public String panicCantRenameIndexFile; @@ -465,6 +466,8 @@ public static JGitText get() { /***/ public String readTimedOut; /***/ public String receivePackObjectTooLarge1; /***/ public String receivePackObjectTooLarge2; + /***/ public String receivePackInvalidLimit; + /***/ public String receivePackTooLarge; /***/ public String receivingObjects; /***/ public String refAlreadyExists; /***/ public String refAlreadyExists1; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java index 1846c47ed..a186b8147 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java @@ -168,6 +168,21 @@ public PackFile getPackFile() { return newPack; } + @Override + public long getPackSize() { + if (newPack == null) + return super.getPackSize(); + + File pack = newPack.getPackFile(); + long size = pack.length(); + String p = pack.getAbsolutePath(); + String i = p.substring(0, p.length() - ".pack".length()) + ".idx"; //$NON-NLS-1$ //$NON-NLS-2$ + File idx = new File(i); + if (idx.exists() && idx.isFile()) + size += idx.length(); + return size; + } + @Override public PackLock parse(ProgressMonitor receiving, ProgressMonitor resolving) throws IOException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java index 414746dc4..a891c8591 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -439,7 +439,7 @@ private boolean processEntry(CanonicalTreeParser base, else { // the preferred version THEIRS has a different mode // than ours. Check it out! - if (isWorktreeDirty(work)) + if (isWorktreeDirty(work, ourDce)) return false; // we know about length and lastMod only after we have written the new content. // This will happen later. Set these values to 0 for know. @@ -477,7 +477,7 @@ private boolean processEntry(CanonicalTreeParser base, // THEIRS. THEIRS is chosen. // Check worktree before checking out THEIRS - if (isWorktreeDirty(work)) + if (isWorktreeDirty(work, ourDce)) return false; if (nonTree(modeT)) { // we know about length and lastMod only after we have written @@ -535,7 +535,7 @@ private boolean processEntry(CanonicalTreeParser base, if (nonTree(modeO) && nonTree(modeT)) { // Check worktree before modifying files - if (isWorktreeDirty(work)) + if (isWorktreeDirty(work, ourDce)) return false; // Don't attempt to resolve submodule link conflicts @@ -566,7 +566,7 @@ private boolean processEntry(CanonicalTreeParser base, // OURS was deleted checkout THEIRS if (modeO == 0) { // Check worktree before checking out THEIRS - if (isWorktreeDirty(work)) + if (isWorktreeDirty(work, ourDce)) return false; if (nonTree(modeT)) { if (e != null) @@ -625,7 +625,8 @@ private boolean isIndexDirty() { return isDirty; } - private boolean isWorktreeDirty(WorkingTreeIterator work) { + private boolean isWorktreeDirty(WorkingTreeIterator work, + DirCacheEntry ourDce) throws IOException { if (work == null) return false; @@ -633,9 +634,15 @@ private boolean isWorktreeDirty(WorkingTreeIterator work) { final int modeO = tw.getRawMode(T_OURS); // Worktree entry has to match ours to be considered clean - boolean isDirty = work.isModeDifferent(modeO); - if (!isDirty && nonTree(modeF)) - isDirty = !tw.idEqual(T_FILE, T_OURS); + boolean isDirty; + if (ourDce != null) + isDirty = work.isModified(ourDce, true, reader); + else { + isDirty = work.isModeDifferent(modeO); + if (!isDirty && nonTree(modeF)) + isDirty = !tw.idEqual(T_FILE, T_OURS); + } + // Ignore existing empty directories if (isDirty && modeF == FileMode.TYPE_TREE && modeO == FileMode.TYPE_MISSING) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java index 39e4aadc9..68b3262a0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java @@ -55,6 +55,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -65,6 +66,7 @@ import org.eclipse.jgit.errors.MissingObjectException; import org.eclipse.jgit.errors.PackProtocolException; +import org.eclipse.jgit.errors.TooLargePackException; import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.internal.storage.file.PackLock; import org.eclipse.jgit.lib.BatchRefUpdate; @@ -89,6 +91,7 @@ import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.transport.ReceiveCommand.Result; import org.eclipse.jgit.util.io.InterruptTimer; +import org.eclipse.jgit.util.io.LimitedInputStream; import org.eclipse.jgit.util.io.TimeoutInputStream; import org.eclipse.jgit.util.io.TimeoutOutputStream; @@ -234,6 +237,12 @@ public Set getCapabilities() { /** Git object size limit */ private long maxObjectSizeLimit; + /** Total pack size limit */ + private long maxPackSizeLimit = -1; + + /** The size of the received pack, including index size */ + private Long packSize; + /** * Create a new pack receive for an open repository. * @@ -622,6 +631,24 @@ public void setMaxObjectSizeLimit(final long limit) { maxObjectSizeLimit = limit; } + + /** + * Set the maximum allowed pack size. + *

+ * A pack exceeding this size will be rejected. + * + * @param limit + * the pack size limit, in bytes + * + * @since 3.3 + */ + public void setMaxPackSizeLimit(final long limit) { + if (limit < 0) + throw new IllegalArgumentException(MessageFormat.format( + JGitText.get().receivePackInvalidLimit, Long.valueOf(limit))); + maxPackSizeLimit = limit; + } + /** * Check whether the client expects a side-band stream. * @@ -696,6 +723,22 @@ public OutputStream getMessageOutputStream() { return msgOutWrapper; } + /** + * Get the size of the received pack file including the index size. + * + * This can only be called if the pack is already received. + * + * @return the size of the received pack including index size + * @throws IllegalStateException + * if called before the pack has been received + * @since 3.3 + */ + public long getPackSize() { + if (packSize != null) + return packSize.longValue(); + throw new IllegalStateException(JGitText.get().packSizeNotSetYet); + } + /** @return true if any commands to be executed have been read. */ protected boolean hasCommands() { return !commands.isEmpty(); @@ -741,6 +784,14 @@ protected void init(final InputStream input, final OutputStream output, rawOut = o; } + if (maxPackSizeLimit >= 0) + rawIn = new LimitedInputStream(rawIn, maxPackSizeLimit) { + @Override + protected void limitExceeded() throws TooLargePackException { + throw new TooLargePackException(limit); + } + }; + pckIn = new PacketLineIn(rawIn); pckOut = new PacketLineOut(rawOut); pckOut.setFlushOnEnd(false); @@ -936,6 +987,7 @@ private void receivePack() throws IOException { parser.setLockMessage(lockMsg); parser.setMaxObjectSizeLimit(maxObjectSizeLimit); packLock = parser.parse(receiving, resolving); + packSize = Long.valueOf(parser.getPackSize()); ins.flush(); } finally { ins.release(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java index e16cce0e3..93522c1e9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java @@ -418,6 +418,20 @@ public List getSortedObjectList( return list; } + /** + * Get the size of the parsed pack. + * + * This will also include the pack index size if an index was created. This + * method should only be called after pack parsing is finished. + * + * @return the pack size (including the index size) or -1 if the size cannot + * be determined + * @since 3.3 + */ + public long getPackSize() { + return -1; + } + /** * Parse the pack stream. * diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java index a50adf91f..70f8327b1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java @@ -206,15 +206,6 @@ protected void initRootIterator(Repository repo) { ignoreNode = new RootIgnoreNode(entry, repo); } - /** - * @return the repository this iterator works with - * - * @since 3.3 - */ - public Repository getRepository() { - return repository; - } - /** * Define the matching {@link DirCacheIterator}, to optimize ObjectIds. * @@ -813,7 +804,8 @@ else if (!entry.isSmudged()) @Deprecated public boolean isModified(DirCacheEntry entry, boolean forceContentCheck) { try { - return isModified(entry, forceContentCheck, null); + return isModified(entry, forceContentCheck, + repository.newObjectReader()); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } @@ -923,7 +915,8 @@ private boolean contentCheck(DirCacheEntry entry, ObjectReader reader) } else { if (mode == FileMode.SYMLINK.getBits()) return !new File(readContentAsNormalizedString(current())) - .equals(new File((readContentAsNormalizedString(entry)))); + .equals(new File((readContentAsNormalizedString(entry, + reader)))); // Content differs: that's a real change, perhaps if (reader == null) // deprecated use, do no further checks return true; @@ -972,9 +965,9 @@ private boolean contentCheck(DirCacheEntry entry, ObjectReader reader) } } - private String readContentAsNormalizedString(DirCacheEntry entry) - throws MissingObjectException, IOException { - ObjectLoader open = repository.open(entry.getObjectId()); + private static String readContentAsNormalizedString(DirCacheEntry entry, + ObjectReader reader) throws MissingObjectException, IOException { + ObjectLoader open = reader.open(entry.getObjectId()); byte[] cachedBytes = open.getCachedBytes(); return FS.detect().normalize(RawParseUtils.decode(cachedBytes)); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/LimitedInputStream.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/LimitedInputStream.java new file mode 100644 index 000000000..85c817204 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/LimitedInputStream.java @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2007 The Guava Authors + * Copyright (C) 2014, Sasa Zivkov , SAP AG + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.eclipse.jgit.util.io; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * Wraps a {@link InputStream}, limiting the number of bytes which can be + * read. + * + * This class was copied and modifed from the Google Guava 16.0. Differently from + * the original Guava code, when a caller tries to read from this stream past + * the given limit and the wrapped stream hasn't yet reached its EOF this class + * will call the limitExceeded method instead of returning EOF. + * + * @since 3.3 + */ +public abstract class LimitedInputStream extends FilterInputStream { + + private long left; + /** Max number of bytes to be read from the wrapped stream */ + protected final long limit; + private long mark = -1; + + /** + * Create a new LimitedInputStream + * + * @param in an InputStream + * @param limit max number of bytes to read from the InputStream + */ + protected LimitedInputStream(InputStream in, long limit) { + super(in); + left = limit; + this.limit = limit; + } + + @Override + public int available() throws IOException { + return (int) Math.min(in.available(), left); + } + + // it's okay to mark even if mark isn't supported, as reset won't work + @Override + public synchronized void mark(int readLimit) { + in.mark(readLimit); + mark = left; + } + + @Override + public int read() throws IOException { + if (left == 0) { + if (in.available() == 0) + return -1; + else + limitExceeded(); + } + + int result = in.read(); + if (result != -1) + --left; + return result; + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + if (left == 0) { + if (in.available() == 0) + return -1; + else + limitExceeded(); + } + + len = (int) Math.min(len, left); + int result = in.read(b, off, len); + if (result != -1) + left -= result; + return result; + } + + @Override + public synchronized void reset() throws IOException { + if (!in.markSupported()) + throw new IOException("Mark not supported"); + + if (mark == -1) + throw new IOException("Mark not set"); + + in.reset(); + left = mark; + } + + @Override + public long skip(long n) throws IOException { + n = Math.min(n, left); + long skipped = in.skip(n); + left -= skipped; + return skipped; + } + + /** + * Called when trying to read past the given {@link #limit} and the wrapped + * InputStream {@link #in} hasn't yet reached its EOF + * + * @throws IOException + * subclasses can throw an IOException when the limit is exceeded. + * The throws IOException will be forwarded back to the caller of + * the read method which read the stream past the limit. + */ + protected abstract void limitExceeded() throws IOException; +} diff --git a/pom.xml b/pom.xml index a27b386ba..fd65fa74f 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ org.eclipse.jgit org.eclipse.jgit-parent pom - 3.3.0-SNAPSHOT + 3.3.1-SNAPSHOT JGit - Parent ${jgit-url} diff --git a/tools/maven-central/deploy.rb b/tools/maven-central/deploy.rb index f169747c7..44abccfc9 100755 --- a/tools/maven-central/deploy.rb +++ b/tools/maven-central/deploy.rb @@ -34,7 +34,7 @@ def get_passphrase(prompt="Enter your GPG Passphrase") ask(prompt) {|q| q.echo = false} end -version = '3.1.0.201310021548-r'.freeze +version = '3.3.0.201403021825-r'.freeze url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' repositoryId = 'sonatype-nexus-staging' puts "gpg passphrase ?" @@ -45,6 +45,7 @@ artifacts = [group, group + '.ant', group + '.archive', group + '.console', + group + '.http.apache', group + '.http.server', group + '.java7', group + '.junit', diff --git a/tools/maven-central/download.rb b/tools/maven-central/download.rb index b5dd871f3..949e6242f 100755 --- a/tools/maven-central/download.rb +++ b/tools/maven-central/download.rb @@ -1,10 +1,11 @@ #!/usr/bin/env ruby -version = '3.1.0.201310021548-r'.freeze +version = '3.3.0.201403021825-r'.freeze group = 'org.eclipse.jgit' artifacts = [group, group + '.ant', group + '.archive', group + '.console', + group + '.http.apache', group + '.http.server', group + '.java7', group + '.junit',