* stable-3.3:
Update scripts to deploy jgit on Maven central
Prepare 3.3.1-SNAPSHOT builds
JGit v3.3.0.201403021825-r
Fix merge/cherry-picking in CRLF mode
Expose the received pack size in ReceivePack
Revert "Add getPackFile to ReceivePack to make PostReceiveHook more usable"
Avoid an NPE after 7b01a53692
Add a launcher for Java 7 tests
Remove obsolete getRepositoryMethod from WorkingTreeIterator
Fix NPE when WorkingTreeIterator does not have a repository set
Add getPackFile to ReceivePack to make PostReceiveHook more usable
Possibility to limit the max pack size on receive-pack
Package httpclient and httpcore in o.e.j.http.apache.feature
Change-Id: I814a150980854bbaabd767f97b062d247af6cb50
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v3.4.0.201405051725-m7
@@ -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)" |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.ant.test</artifactId> |
@@ -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" |
@@ -48,7 +48,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.ant</artifactId> |
@@ -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, |
@@ -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="." |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.archive</artifactId> |
@@ -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)" |
@@ -52,7 +52,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.console</artifactId> |
@@ -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, |
@@ -48,7 +48,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.http.apache</artifactId> |
@@ -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)" |
@@ -52,7 +52,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.http.server</artifactId> |
@@ -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)", |
@@ -51,7 +51,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.http.test</artifactId> |
@@ -0,0 +1,165 @@ | |||
/* | |||
* Copyright (C) 2014, Matthias Sohn <matthias.sohn@sap.com> | |||
* 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<Repository> src = createTestRepository(); | |||
final String srcName = src.getRepository().getDirectory().getName(); | |||
ServletContextHandler app = server.addContext("/git"); | |||
GitServlet gs = new GitServlet(); | |||
gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() { | |||
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<ReceiveCommand> 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); | |||
} | |||
} |
@@ -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)" |
@@ -0,0 +1,20 @@ | |||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> | |||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | |||
<listEntry value="/org.eclipse.jgit.java7.test"/> | |||
</listAttribute> | |||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | |||
<listEntry value="4"/> | |||
</listAttribute> | |||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> | |||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> | |||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> | |||
</listAttribute> | |||
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.java7.test"/> | |||
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> | |||
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> | |||
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> | |||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | |||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> | |||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.java7.test"/> | |||
</launchConfiguration> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.java7.test</artifactId> |
@@ -114,7 +114,8 @@ public class FileTreeIteratorJava7Test extends RepositoryTestCase { | |||
assertEquals("link", dci.getEntryPathString()); | |||
// test | |||
assertFalse(fti.isModified(dci.getDirCacheEntry(), true)); | |||
assertFalse(fti.isModified(dci.getDirCacheEntry(), true, | |||
db.newObjectReader())); | |||
} | |||
/** | |||
@@ -195,6 +196,7 @@ public class FileTreeIteratorJava7Test extends RepositoryTestCase { | |||
assertEquals("link", dci.getEntryPathString()); | |||
// test | |||
assertTrue(fti.isModified(dci.getDirCacheEntry(), true)); | |||
assertTrue(fti.isModified(dci.getDirCacheEntry(), true, | |||
db.newObjectReader())); | |||
} | |||
} |
@@ -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" |
@@ -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="." | |||
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.java7</artifactId> |
@@ -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" |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.junit.http</artifactId> |
@@ -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" |
@@ -52,7 +52,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.junit</artifactId> |
@@ -2,7 +2,7 @@ | |||
<feature | |||
id="org.eclipse.jgit" | |||
label="%featureName" | |||
version="3.3.0.qualifier" | |||
version="3.3.1.qualifier" | |||
provider-name="%providerName"> | |||
<description url="http://www.eclipse.org/jgit/"> | |||
@@ -57,18 +57,4 @@ | |||
version="0.0.0" | |||
unpack="false"/> | |||
<plugin | |||
id="org.apache.httpcomponents.httpcore" | |||
download-size="0" | |||
install-size="0" | |||
version="0.0.0" | |||
unpack="false"/> | |||
<plugin | |||
id="org.apache.httpcomponents.httpclient" | |||
download-size="0" | |||
install-size="0" | |||
version="0.0.0" | |||
unpack="false"/> | |||
</feature> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<groupId>org.eclipse.jgit.feature</groupId> |
@@ -2,7 +2,7 @@ | |||
<feature | |||
id="org.eclipse.jgit.http.apache" | |||
label="%featureName" | |||
version="3.3.0.qualifier" | |||
version="3.3.1.qualifier" | |||
provider-name="%providerName"> | |||
<description url="http://www.eclipse.org/jgit/"> | |||
@@ -33,4 +33,18 @@ | |||
version="0.0.0" | |||
unpack="false"/> | |||
<plugin | |||
id="org.apache.httpcomponents.httpcore" | |||
download-size="0" | |||
install-size="0" | |||
version="0.0.0" | |||
unpack="false"/> | |||
<plugin | |||
id="org.apache.httpcomponents.httpclient" | |||
download-size="0" | |||
install-size="0" | |||
version="0.0.0" | |||
unpack="false"/> | |||
</feature> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<groupId>org.eclipse.jgit.feature</groupId> |
@@ -2,7 +2,7 @@ | |||
<feature | |||
id="org.eclipse.jgit.java7" | |||
label="%featureName" | |||
version="3.3.0.qualifier" | |||
version="3.3.1.qualifier" | |||
provider-name="%providerName"> | |||
<description url="http://www.eclipse.org/jgit/"> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<groupId>org.eclipse.jgit.feature</groupId> |
@@ -2,7 +2,7 @@ | |||
<feature | |||
id="org.eclipse.jgit.junit" | |||
label="%featureName" | |||
version="3.3.0.qualifier" | |||
version="3.3.1.qualifier" | |||
provider-name="%providerName"> | |||
<description url="http://www.eclipse.org/jgit/"> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<groupId>org.eclipse.jgit.feature</groupId> |
@@ -2,7 +2,7 @@ | |||
<feature | |||
id="org.eclipse.jgit.pgm" | |||
label="%featureName" | |||
version="3.3.0.qualifier" | |||
version="3.3.1.qualifier" | |||
provider-name="%providerName"> | |||
<description url="http://www.eclipse.org/jgit/"> | |||
@@ -27,7 +27,7 @@ | |||
version="0.0.0"/> | |||
<requires> | |||
<import feature="org.eclipse.jgit" version="3.3.0" match="equivalent"/> | |||
<import feature="org.eclipse.jgit" version="3.3.1" match="equivalent"/> | |||
</requires> | |||
<plugin |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<groupId>org.eclipse.jgit.feature</groupId> |
@@ -2,7 +2,7 @@ | |||
<feature | |||
id="org.eclipse.jgit.pgm.source" | |||
label="%featureName" | |||
version="3.3.0.qualifier" | |||
version="3.3.1.qualifier" | |||
provider-name="%providerName"> | |||
<description url="http://www.eclipse.org/jgit/"> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<groupId>org.eclipse.jgit.feature</groupId> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.repository</artifactId> |
@@ -2,7 +2,7 @@ | |||
<feature | |||
id="org.eclipse.jgit.source" | |||
label="%featureName" | |||
version="3.3.0.qualifier" | |||
version="3.3.1.qualifier" | |||
provider-name="%providerName"> | |||
<description url="http://www.eclipse.org/jgit/"> |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<groupId>org.eclipse.jgit.feature</groupId> |
@@ -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 |
@@ -49,7 +49,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.target</artifactId> |
@@ -53,7 +53,7 @@ | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>jgit.tycho.parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
<packaging>pom</packaging> | |||
<name>JGit Tycho Parent</name> |
@@ -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)" |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.pgm.test</artifactId> |
@@ -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, |
@@ -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="." |
@@ -50,7 +50,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.pgm</artifactId> |
@@ -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)", |
@@ -52,7 +52,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.test</artifactId> |
@@ -53,6 +53,7 @@ import org.eclipse.jgit.api.Git; | |||
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 class ResolveMergerTest extends RepositoryTestCase { | |||
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. |
@@ -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)" |
@@ -52,7 +52,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit.ui</artifactId> |
@@ -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)" |
@@ -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="." |
@@ -53,7 +53,7 @@ | |||
<parent> | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
</parent> | |||
<artifactId>org.eclipse.jgit</artifactId> |
@@ -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 |
@@ -0,0 +1,69 @@ | |||
/* | |||
* Copyright (C) 2014, Sasa Zivkov <sasa.zivkov@sap.com>, 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))); | |||
} | |||
} |
@@ -440,6 +440,7 @@ public class JGitText extends TranslationBundle { | |||
/***/ 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 class JGitText extends TranslationBundle { | |||
/***/ public String readTimedOut; | |||
/***/ public String receivePackObjectTooLarge1; | |||
/***/ public String receivePackObjectTooLarge2; | |||
/***/ public String receivePackInvalidLimit; | |||
/***/ public String receivePackTooLarge; | |||
/***/ public String receivingObjects; | |||
/***/ public String refAlreadyExists; | |||
/***/ public String refAlreadyExists1; |
@@ -168,6 +168,21 @@ public class ObjectDirectoryPackParser extends PackParser { | |||
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 { |
@@ -439,7 +439,7 @@ public class ResolveMerger extends ThreeWayMerger { | |||
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 @@ public class ResolveMerger extends ThreeWayMerger { | |||
// 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 @@ public class ResolveMerger extends ThreeWayMerger { | |||
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 @@ public class ResolveMerger extends ThreeWayMerger { | |||
// 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 @@ public class ResolveMerger extends ThreeWayMerger { | |||
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 @@ public class ResolveMerger extends ThreeWayMerger { | |||
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) |
@@ -55,6 +55,7 @@ import java.io.EOFException; | |||
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 java.util.concurrent.TimeUnit; | |||
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.RevTree; | |||
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 abstract class BaseReceivePack { | |||
/** 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 abstract class BaseReceivePack { | |||
maxObjectSizeLimit = limit; | |||
} | |||
/** | |||
* Set the maximum allowed pack size. | |||
* <p> | |||
* 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 abstract class BaseReceivePack { | |||
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 @@ public abstract class BaseReceivePack { | |||
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 @@ public abstract class BaseReceivePack { | |||
parser.setLockMessage(lockMsg); | |||
parser.setMaxObjectSizeLimit(maxObjectSizeLimit); | |||
packLock = parser.parse(receiving, resolving); | |||
packSize = Long.valueOf(parser.getPackSize()); | |||
ins.flush(); | |||
} finally { | |||
ins.release(); |
@@ -418,6 +418,20 @@ public abstract class PackParser { | |||
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. | |||
* |
@@ -206,15 +206,6 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { | |||
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 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { | |||
@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 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { | |||
} 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 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { | |||
} | |||
} | |||
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)); | |||
} |
@@ -0,0 +1,154 @@ | |||
/* | |||
* Copyright (C) 2007 The Guava Authors | |||
* Copyright (C) 2014, Sasa Zivkov <sasa.zivkov@sap.com>, 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; | |||
} |
@@ -51,7 +51,7 @@ | |||
<groupId>org.eclipse.jgit</groupId> | |||
<artifactId>org.eclipse.jgit-parent</artifactId> | |||
<packaging>pom</packaging> | |||
<version>3.3.0-SNAPSHOT</version> | |||
<version>3.3.1-SNAPSHOT</version> | |||
<name>JGit - Parent</name> | |||
<url>${jgit-url}</url> |
@@ -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', |
@@ -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', |