Merge branch 'master' into stable-5.13

* master:
  GitServlet: allow to override default error handlers
  Silence API error for new interface method ProtocolV2Hook#onObjectInfo
  transport: add object-info capability
  Ignore IllegalStateException if JVM is already shutting down
  Update orbit to R20210825222808 for 2021-09
  RevWalk: getMergedInto's result is wrong on the second call

Change-Id: I007882d0c663e406d8845cc807f3792ae7673230
This commit is contained in:
Matthias Sohn 2021-09-01 16:31:13 +02:00
commit 6fc54671e0
47 changed files with 342 additions and 55 deletions

View File

@ -112,6 +112,17 @@ public void setUploadPackFactory(UploadPackFactory<HttpServletRequest> f) {
gitFilter.setUploadPackFactory(f);
}
/**
* Set a custom error handler for git-upload-pack.
*
* @param h
* A custom error handler for git-upload-pack.
* @since 5.9.1
*/
public void setUploadPackErrorHandler(UploadPackErrorHandler h) {
gitFilter.setUploadPackErrorHandler(h);
}
/**
* Add upload-pack filter
*
@ -136,6 +147,17 @@ public void setReceivePackFactory(ReceivePackFactory<HttpServletRequest> f) {
gitFilter.setReceivePackFactory(f);
}
/**
* Set a custom error handler for git-receive-pack.
*
* @param h
* A custom error handler for git-receive-pack.
* @since 5.9.1
*/
public void setReceivePackErrorHandler(ReceivePackErrorHandler h) {
gitFilter.setReceivePackErrorHandler(h);
}
/**
* Add receive-pack filter
*

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.10" sequenceNumber="1629705488">
<target name="jgit-4.10" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.10" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2018-12/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.11" sequenceNumber="1629705565">
<target name="jgit-4.11" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.11" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2019-03/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.12" sequenceNumber="1629705566">
<target name="jgit-4.12" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.12" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2019-06/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.13" sequenceNumber="1629705566">
<target name="jgit-4.13" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.13" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2019-09/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.14" sequenceNumber="1629705564">
<target name="jgit-4.14" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.14" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2019-12/201912181000/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.15" sequenceNumber="1629705564">
<target name="jgit-4.15" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.15" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2020-03/202003181000/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.16" sequenceNumber="1629705566">
<target name="jgit-4.16" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.16" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2020-06/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.17" sequenceNumber="1629705566">
<target name="jgit-4.17" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.17" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2020-09/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.18" sequenceNumber="1629705566">
<target name="jgit-4.18" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.18" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2020-12/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.19-staging" sequenceNumber="1629705564">
<target name="jgit-4.19-staging" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.19-staging" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/staging/2021-03/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.20" sequenceNumber="1629705566">
<target name="jgit-4.20" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.20" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2021-06/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.21" sequenceNumber="1629705585">
<target name="jgit-4.21" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.21" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/staging/2021-09/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.6" sequenceNumber="1629705580">
<target name="jgit-4.6" sequenceNumber="1630003285">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.6" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/neon/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.7" sequenceNumber="1629705612">
<target name="jgit-4.7" sequenceNumber="1630003276">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.7" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/oxygen/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.8" sequenceNumber="1629705566">
<target name="jgit-4.8" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.8" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/photon/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="jgit-4.9" sequenceNumber="1629705566">
<target name="jgit-4.9" sequenceNumber="1630003272">
<locations>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.jetty.client" version="9.4.43.v20210629"/>
@ -89,7 +89,7 @@
<unit id="org.slf4j.binding.log4j12.source" version="1.7.30.v20201108-2042"/>
<unit id="org.tukaani.xz" version="1.9.0.v20210624-1259"/>
<unit id="org.tukaani.xz.source" version="1.9.0.v20210624-1259"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository"/>
</location>
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
<unit id="org.eclipse.osgi" version="0.0.0"/>

View File

@ -1,7 +1,7 @@
target "jgit-4.9" with source configurePhase
include "projects/jetty-9.4.x.tpd"
include "orbit/staging.tpd"
include "orbit/R20210825222808-2021-09.tpd"
location "https://download.eclipse.org/releases/2018-09/" {
org.eclipse.osgi lazy

View File

@ -1,7 +1,7 @@
target "staging" with source configurePhase
target "R20210825222808-2021-09" with source configurePhase
// see https://download.eclipse.org/tools/orbit/downloads/
location "https://download.eclipse.org/tools/orbit/downloads/drops/S20210817231813/repository" {
location "https://download.eclipse.org/tools/orbit/downloads/drops/R20210825222808/repository" {
com.google.gson [2.8.7.v20210624-1215,2.8.7.v20210624-1215]
com.google.gson.source [2.8.7.v20210624-1215,2.8.7.v20210624-1215]
com.jcraft.jsch [0.1.55.v20190404-1902,0.1.55.v20190404-1902]

View File

@ -219,8 +219,12 @@ public final void execute(String[] args) throws Exception {
case APACHE: {
SshdSessionFactory factory = new SshdSessionFactory(
new JGitKeyCache(), new DefaultProxyDataFactory());
Runtime.getRuntime()
.addShutdownHook(new Thread(factory::close));
try {
Runtime.getRuntime()
.addShutdownHook(new Thread(factory::close));
} catch (IllegalStateException e) {
// ignore - the VM is already shutting down
}
SshSessionFactory.setInstance(factory);
break;
}

View File

@ -76,6 +76,28 @@ public void withCommitLoadedByDifferentRevWalk() throws Exception {
}
}
@Test
public void findBranchesReachableManyTimes() throws Exception {
/*
* a b
* | |
* c d
*/
RevCommit a = commit();
RevCommit b = commit();
RevCommit c = commit(a);
RevCommit d = commit(b);
Ref branchA = branch("a", a);
Ref branchB = branch("b", b);
Ref branchC = branch("c", c);
Ref branchD = branch("d", d);
assertContains(a, asList(branchA, branchC));
assertContains(b, asList(branchB, branchD));
assertContains(c, asList(branchC));
assertContains(d, asList(branchD));
}
private Ref branch(String name, RevCommit dst) throws Exception {
return Git.wrap(db).branchCreate().setName(name)
.setStartPoint(dst.name()).call();

View File

@ -460,6 +460,8 @@ private static class TestV2Hook implements ProtocolV2Hook {
private FetchV2Request fetchRequest;
private ObjectInfoRequest objectInfoRequest;
@Override
public void onCapabilities(CapabilitiesV2Request req) {
capabilitiesRequest = req;
@ -474,6 +476,11 @@ public void onLsRefs(LsRefsV2Request req) {
public void onFetch(FetchV2Request req) {
fetchRequest = req;
}
@Override
public void onObjectInfo(ObjectInfoRequest req) {
objectInfoRequest = req;
}
}
@Test
@ -2641,4 +2648,44 @@ public RefDatabase getRefDatabase() {
return refdb;
}
}
@Test
public void testObjectInfo() throws Exception {
server.getConfig().setBoolean("uploadpack", null, "advertiseobjectinfo",
true);
RevBlob blob1 = remote.blob("foobar");
RevBlob blob2 = remote.blob("fooba");
RevTree tree = remote.tree(remote.file("1", blob1),
remote.file("2", blob2));
RevCommit commit = remote.commit(tree);
remote.update("master", commit);
TestV2Hook hook = new TestV2Hook();
ByteArrayInputStream recvStream = uploadPackV2((UploadPack up) -> {
up.setProtocolV2Hook(hook);
}, "command=object-info\n", "size",
"oid " + ObjectId.toString(blob1.getId()),
"oid " + ObjectId.toString(blob2.getId()), PacketLineIn.end());
PacketLineIn pckIn = new PacketLineIn(recvStream);
assertThat(hook.objectInfoRequest, notNullValue());
assertThat(pckIn.readString(), is("size"));
assertThat(pckIn.readString(),
is(ObjectId.toString(blob1.getId()) + " 6"));
assertThat(pckIn.readString(),
is(ObjectId.toString(blob2.getId()) + " 5"));
assertTrue(PacketLineIn.isEnd(pckIn.readString()));
}
@Test
public void testObjectInfo_invalidOid() throws Exception {
server.getConfig().setBoolean("uploadpack", null, "advertiseobjectinfo",
true);
assertThrows(UploadPackInternalServerErrorException.class,
() -> uploadPackV2("command=object-info\n", "size",
"oid invalid",
PacketLineIn.end()));
}
}

View File

@ -8,6 +8,14 @@
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/jgit/transport/ProtocolV2Hook.java" type="org.eclipse.jgit.transport.ProtocolV2Hook">
<filter id="404000815">
<message_arguments>
<message_argument value="org.eclipse.jgit.transport.ProtocolV2Hook"/>
<message_argument value="onObjectInfo(ObjectInfoRequest)"/>
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/jgit/transport/SshConstants.java" type="org.eclipse.jgit.transport.SshConstants">
<filter id="1142947843">
<message_arguments>

View File

@ -173,7 +173,11 @@ public Git call() throws GitAPIException, InvalidRemoteException,
Repository repository = init();
FetchResult fetchResult = null;
Thread cleanupHook = new Thread(() -> cleanup());
Runtime.getRuntime().addShutdownHook(cleanupHook);
try {
Runtime.getRuntime().addShutdownHook(cleanupHook);
} catch (IllegalStateException e) {
// ignore - the VM is already shutting down
}
try {
fetchResult = fetch(repository, u);
} catch (IOException ioe) {
@ -197,7 +201,11 @@ public Git call() throws GitAPIException, InvalidRemoteException,
cleanup();
throw e;
} finally {
Runtime.getRuntime().removeShutdownHook(cleanupHook);
try {
Runtime.getRuntime().removeShutdownHook(cleanupHook);
} catch (IllegalStateException e) {
// ignore - the VM is already shutting down
}
}
if (!noCheckout) {
try {

View File

@ -527,10 +527,12 @@ public boolean isMergedIntoAll(RevCommit commit, Collection<Ref> refs)
private List<Ref> getMergedInto(RevCommit needle, Collection<Ref> haystacks,
Enum returnStrategy, ProgressMonitor monitor) throws IOException {
List<Ref> result = new ArrayList<>();
List<RevCommit> uninteresting = new ArrayList<>();
RevFilter oldRF = filter;
TreeFilter oldTF = treeFilter;
try {
finishDelayedFreeFlags();
reset(~freeFlags & APP_FLAGS);
filter = RevFilter.ALL;
treeFilter = TreeFilter.ALL;
for (Ref r: haystacks) {
@ -559,13 +561,14 @@ private List<Ref> getMergedInto(RevCommit needle, Collection<Ref> haystacks,
}
if(!commitFound){
markUninteresting(c);
uninteresting.add(c);
if (returnStrategy == GetMergedIntoStrategy.RETURN_ON_FIRST_NOT_FOUND) {
return result;
}
}
}
} finally {
reset(~freeFlags & APP_FLAGS);
roots.addAll(uninteresting);
filter = oldRF;
treeFilter = oldTF;
}

View File

@ -254,6 +254,13 @@ public final class GitProtocolConstants {
*/
public static final String COMMAND_FETCH = "fetch"; //$NON-NLS-1$
/**
* The server supports the object-info capability.
*
* @since 5.13
*/
public static final String COMMAND_OBJECT_INFO = "object-info"; //$NON-NLS-1$
/**
* HTTP header to set by clients to request a specific git protocol version
* in the HTTP transport.

View File

@ -0,0 +1,69 @@
/*
* Copyright (C) 2021, Google LLC. and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0 which is available at
* https://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package org.eclipse.jgit.transport;
import java.util.Collections;
import java.util.List;
import org.eclipse.jgit.lib.ObjectId;
/**
* object-info request.
*
* <p>
* This is the parsed request for an object-info call, used as input to
* {@link ProtocolV2Hook}.
*
* @see <a href=
* "https://www.kernel.org/pub/software/scm/git/docs/technical/protocol-v2.html#_object_info">object-info
* documentation</a>
*
* @since 5.13
*/
public final class ObjectInfoRequest {
private final List<ObjectId> objectIDs;
private ObjectInfoRequest(List<ObjectId> objectIDs) {
this.objectIDs = objectIDs;
}
/** @return object IDs that the client requested. */
public List<ObjectId> getObjectIDs() {
return this.objectIDs;
}
/** @return A builder of {@link ObjectInfoRequest}. */
public static Builder builder() {
return new Builder();
}
/** A builder for {@link ObjectInfoRequest}. */
public static final class Builder {
private List<ObjectId> objectIDs = Collections.emptyList();
private Builder() {
}
/**
* @param value
* @return the Builder
*/
public Builder setObjectIDs(List<ObjectId> value) {
objectIDs = value;
return this;
}
/** @return ObjectInfoRequest */
public ObjectInfoRequest build() {
return new ObjectInfoRequest(
Collections.unmodifiableList(objectIDs));
}
}
}

View File

@ -55,4 +55,16 @@ default void onFetch(FetchV2Request req)
throws ServiceMayNotContinueException {
// Do nothing by default
}
/**
* @param req
* the object-info request
* @throws ServiceMayNotContinueException
* abort; the message will be sent to the user
* @since 5.13
*/
default void onObjectInfo(ObjectInfoRequest req)
throws ServiceMayNotContinueException {
// Do nothing by default
}
}

View File

@ -71,6 +71,14 @@ public void onFetch(FetchV2Request req)
}
}
@Override
public void onObjectInfo(ObjectInfoRequest req)
throws ServiceMayNotContinueException {
for (ProtocolV2Hook hook : hooks) {
hook.onObjectInfo(req);
}
}
private ProtocolV2HookChain(List<? extends ProtocolV2Hook> hooks) {
this.hooks = Collections.unmodifiableList(hooks);
}

View File

@ -28,6 +28,7 @@
import java.util.List;
import java.util.function.Consumer;
import org.eclipse.jgit.errors.InvalidObjectIdException;
import org.eclipse.jgit.errors.PackProtocolException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.ObjectId;
@ -248,4 +249,38 @@ LsRefsV2Request parseLsRefsRequest(PacketLineIn pckIn)
return builder.setRefPrefixes(prefixes).build();
}
ObjectInfoRequest parseObjectInfoRequest(PacketLineIn pckIn)
throws PackProtocolException, IOException {
ObjectInfoRequest.Builder builder = ObjectInfoRequest.builder();
List<ObjectId> objectIDs = new ArrayList<>();
String line = pckIn.readString();
if (PacketLineIn.isEnd(line)) {
return builder.build();
}
if (!line.equals("size")) { //$NON-NLS-1$
throw new PackProtocolException(MessageFormat
.format(JGitText.get().unexpectedPacketLine, line));
}
for (String line2 : pckIn.readStrings()) {
if (!line2.startsWith("oid ")) { //$NON-NLS-1$
throw new PackProtocolException(MessageFormat
.format(JGitText.get().unexpectedPacketLine, line2));
}
String oidStr = line2.substring("oid ".length()); //$NON-NLS-1$
try {
objectIDs.add(ObjectId.fromString(oidStr));
} catch (InvalidObjectIdException e) {
throw new PackProtocolException(MessageFormat
.format(JGitText.get().invalidObject, oidStr), e);
}
}
return builder.setObjectIDs(objectIDs).build();
}
}

View File

@ -123,6 +123,7 @@ static ProtocolVersion parse(@Nullable String name) {
private final boolean advertiseSidebandAll;
private final boolean advertiseWaitForDone;
private final boolean advertiseObjectInfo;
final @Nullable ProtocolVersion protocolVersion;
final String[] hideRefs;
@ -211,6 +212,8 @@ public TransferConfig(Config rc) {
"advertisesidebandall", false);
advertiseWaitForDone = rc.getBoolean("uploadpack",
"advertisewaitfordone", false);
advertiseObjectInfo = rc.getBoolean("uploadpack",
"advertiseobjectinfo", false);
}
/**
@ -317,6 +320,14 @@ public boolean isAdvertiseWaitForDone() {
return advertiseWaitForDone;
}
/**
* @return true to advertise object-info to all clients
* @since 5.13
*/
public boolean isAdvertiseObjectInfo() {
return advertiseObjectInfo;
}
/**
* Get {@link org.eclipse.jgit.transport.RefFilter} respecting configured
* hidden refs.

View File

@ -17,6 +17,7 @@
import static org.eclipse.jgit.transport.GitProtocolConstants.CAPABILITY_SERVER_OPTION;
import static org.eclipse.jgit.transport.GitProtocolConstants.COMMAND_FETCH;
import static org.eclipse.jgit.transport.GitProtocolConstants.COMMAND_LS_REFS;
import static org.eclipse.jgit.transport.GitProtocolConstants.COMMAND_OBJECT_INFO;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_AGENT;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_ALLOW_REACHABLE_SHA1_IN_WANT;
import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_ALLOW_TIP_SHA1_IN_WANT;
@ -1269,6 +1270,32 @@ private void fetchV2(PacketLineOut pckOut) throws IOException {
}
}
private void objectInfo(PacketLineOut pckOut) throws IOException {
ProtocolV2Parser parser = new ProtocolV2Parser(transferConfig);
ObjectInfoRequest req = parser.parseObjectInfoRequest(pckIn);
protocolV2Hook.onObjectInfo(req);
ObjectReader or = getRepository().newObjectReader();
// Size is the only attribute currently supported.
pckOut.writeString("size"); //$NON-NLS-1$
for (ObjectId oid : req.getObjectIDs()) {
long size;
try {
size = or.getObjectSize(oid, ObjectReader.OBJ_ANY);
} catch (MissingObjectException e) {
throw new PackProtocolException(MessageFormat
.format(JGitText.get().missingObject, oid.name()), e);
}
pckOut.writeString(oid.getName() + " " + size); //$NON-NLS-1$
}
pckOut.end();
}
/*
* Returns true if this is the last command and we should tear down the
* connection.
@ -1295,6 +1322,10 @@ private boolean serveOneCommandV2(PacketLineOut pckOut) throws IOException {
fetchV2(pckOut);
return false;
}
if (command.equals("command=" + COMMAND_OBJECT_INFO)) { //$NON-NLS-1$
objectInfo(pckOut);
return false;
}
throw new PackProtocolException(MessageFormat
.format(JGitText.get().unknownTransportCommand, command));
}