Commit Graph

6292 Commits

Author SHA1 Message Date
Matthias Sohn 0c12df54f1 Remove unnecessary maven dependency of org.eclipse.jgit to httpclient
Change-Id: Icc3c696a46adaf0e7b633913a3f36f0440a81e3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-20 04:54:51 -04:00
Matthias Sohn 6dd25814d8 Update bazel dependencies to match maven dependencies
Update
- jsch to 0.1.54
- httpclient to 4.5.5
- httpcore to 4.4.9
- commons-codec to 1.10
- commons-logging to 1.2
- junit to 4.12

Change-Id: I84eeb8dd786e68dd03079ae2c2aef5d7286dfb56
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-20 16:57:01 +09:00
Andrey Loskutov 5a95e7e74b SubmoduleDeinitTest fails on Windows
Bug: 538068
Change-Id: I982e8b12936582e8e119f45d7a3bf4888d3e0e1a
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2018-08-19 20:53:31 +02:00
Andrey Loskutov c23d024ea8 FilterCommandsTest fails on Windows
Bug: 538068
Change-Id: I3ba6fceef2c34cacc0c37150206379aa93b5e3d0
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2018-08-19 20:32:00 +02:00
Andrey Loskutov 6e4b9bd274 ReceivePackAdvertiseRefsHookTest.testSuccess() fails on Windows
The TransportLocal object created in
newTransportLocalWithStrictValidation() closes original repository and
increments use of test internal "dst" repository, but never decrements
use. Because of this, pack file is not closed and during tearDown on
Windows system is unable to delete it.

Bug: 538068
Change-Id: I96df8e91abfee78c91cf26c2466718e9145a69db
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2018-08-19 20:24:20 +02:00
Matthias Sohn b31f966188 Update Jetty to 9.4.11.v20180605
Change-Id: I1d2ad0536a0fd02361e17d0175eaeca2c047660c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 19:40:50 +02:00
Matthias Sohn 60c7791918 Merge branch 'stable-5.0'
* stable-5.0:
  Fix GC run in foreground to not use executor

Change-Id: I484391e5589d70de136126d153f886f5afa12e88
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 13:57:42 +02:00
Matthias Sohn 78d7d9916c Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Fix GC run in foreground to not use executor

Change-Id: I9bb1506805a2d5e79a420a1152bc45321c081229
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 13:55:24 +02:00
Matthias Sohn c415e93e8a Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Fix GC run in foreground to not use executor

Change-Id: I565b95de6c89f021475667caaacdbb08caddd881
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 13:51:45 +02:00
Matthias Sohn 9b55f1a278 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Fix GC run in foreground to not use executor

Change-Id: Ib4d76125fca7eec9e88666688b5e614e7e20dde7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 13:51:00 +02:00
Matthias Sohn ce84d0dfc6 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Fix GC run in foreground to not use executor

Change-Id: Id9d864a8e727fefa35ca87eccb4e3801eb689c3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 13:47:51 +02:00
Matthias Sohn 96beadbbc1 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Fix GC run in foreground to not use executor

Change-Id: Ib150d132e2ce055d36ddffb2dbc37b5cb355e77a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 13:40:33 +02:00
Matthias Sohn fb327145f0 Update org.apache.commons.codec and org.apache.commons.logging
Update
- org.apache.commons.codec to 1.10.0.v20180409-1845
- org.apache.commons.logging to 1.2.0.v20180409-1502

According to [1] this is required for the update of httpcore and
httpclient we did in 63a3e415.

[1] https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg15823.html

CQ: 16962
CQ: 16963
Change-Id: I1d40ffc90d17fe2c29ad704013535f20af4b231b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-18 11:29:35 +02:00
Matthias Sohn 7a536cef06 Merge branch 'stable-5.0'
* stable-5.0:
  Fix wrong warning message in case of lock failures

Change-Id: Ia9b813652a2f5b6c78e9587367c35c3a6c177a7a
2018-08-17 01:24:10 +02:00
Matthias Sohn 63a3e415e7 Update apache httpcore and httpclient
Update
- org.apache.httpcomponents.httpclient to 4.5.5.v20180409-1525
- org.apache.httpcomponents.httpcore to 4.4.9.v20180409-1525

CQ: 16959
CQ: 16960
Change-Id: I11f2979e1c39fe26421693a7c694e51c471326a0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-17 00:26:00 +02:00
Christian Halstrick 982be5db14 Fix wrong warning message in case of lock failures
Bug: 537969
Change-Id: I0854bbbe7393abaca36640d429886c30d95d5bf1
2018-08-16 14:30:46 -05:00
Masaya Suzuki 3aa2b8064c Introduce ProtocolV2Hook
In Git protocol v2, UploadPack and ReceivePack have the same
capabilities and can process any protocol v2 request. For example, a
client can sent a "fetch" command to the "/git-receive-pack" endpoint.

This makes it difficult for existing hook interfaces. For example,
PreUploadHook takes UploadPack, but a "fetch" command may be received by
ReceivePack.

To resolve this skew, this change introduce a different hook interface
for the protocol v2. The hook takes a request that is independent to the
handlers (UploadPack, ReceivePack). Also this makes it clear what
parameters the hook is counting on, instead of keep track of the hook
using getters from UploadPack / ReceivePack.

Bug: 534847
Change-Id: I71f3266584483db1e2b2edfc1a72d0bdf1bb6041
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
2018-08-16 11:22:17 -07:00
Hugo Arès d4a19c328f Fix GC run in foreground to not use executor
Since I3870cadb4, GC task was always delegated to an executor even when
background option was set to false. This was an issue because if more
than one GC object was instantiated and executed in parallel, only one GC
was actually running because of the single thread executor.

Change-Id: I8c587d22d63c1601b7d75914692644a385cd86d6
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
2018-08-15 19:53:33 -05:00
Dave Borowitz 62562295c0 Add EMPTY_TREE_ID as a sibling of EMPTY_BLOB_ID
Change-Id: Id68b3e1db7294cf9adb8b4ce8eecb1d828687eef
2018-08-15 15:59:55 -07:00
Dave Borowitz 289f116dbb Update javadoc for EMPTY_BLOB_ID
Found original version with:

  $ git describe --contains $(git blame fc4d4b5340 org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java | grep EMPTY_BLOB_ID | cut -d' ' -f1)
  v0.9.1~164

Change-Id: I1f86bde42615c8b64064894bde44f82660b38d0f
2018-08-15 15:59:23 -07:00
Jonathan Nieder fc4d4b5340 Merge "Declare ConfigConstants and GitProtocolConstants final" 2018-08-14 18:55:26 -04:00
Matthias Sohn 31a72f5da7 Declare ConfigConstants and GitProtocolConstants final
This avoids that we have to suppress API errors whenever we add a new
constant in a minor release. This change affects implementors only which
is ok to do in a minor release following OSGi semantic versioning rules.

Change-Id: Iece841886fbe00f1ba567c5ff68093c542ba265e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-15 00:32:41 +02:00
Jonathan Tan 3227348e5e Respond with shallow-info before wanted-refs
When fetching with protocol v2, git expects the shallow-info section to
appear before wanted-refs if both appear in the response. Teach
UploadPack to do this.

Change-Id: Ie26a91edcce5d27a1d727d7fba5c30e1144e118b
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-08-13 16:57:25 -07:00
Han-Wen Nienhuys d1dc49e968 Use a TreeMap to construct the list of renamed projects
This eliminates one source of unpredictable ordering of entries in .gitmodules.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I834ae57bd18f51966ef76c039f5212ebf60a33e8
2018-08-13 12:17:58 -04:00
Gunnar Wagenknecht 82e0c4a084 Merge "Fix ResolveMerger: rebase with autocrlf=true, direct checkout" 2018-08-13 07:36:44 -04:00
Thomas Wolf 4027c5c9ff Fix ResolveMerger: rebase with autocrlf=true, direct checkout
ResolveMerger.checkout() and cleanUp() check out files directly and
must honor CR/LF settings and also smudge filters.

Deprecate the 3-argument version of DirCacheCheckout.checkoutEntry().
It isn't used anymore anywhere in JGit (nor in EGit).

Bug: 537410
Change-Id: I062b35401c8bd5bc99deb2f68f91089a0643504c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-08-13 13:15:24 +02:00
Jonathan Tan c477b0ddcb Support protocol v2 want-ref in UploadPack
UploadPack already allows the client to send wanted OIDs as "want"
lines. Extend UploadPack to also allow the client to send wanted ref
names as "want-ref" lines when the fetch is done using protocol v2.

The corresponding Git commit is 516e2b76bd ("upload-pack: implement
ref-in-want", 2018-06-28).

To support a two-stage rollout, two configuration variables are
provided: uploadpack.allowrefinwant (default "false") allows clients to
specify "want-ref" in their requests, and uploadpack.advertiserefinwant
(default "true") makes UploadPack advertise this capability. If
uploadpack.allowrefinwant is true but uploadpack.advertiserefinwant is
false, UploadPack will not advertise that it supports "want-ref", but it
will support it.

Change-Id: I3c24077949640d453af90d81a7f48ce4b8ac9833
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
2018-08-10 18:44:49 -04:00
Thomas Wolf bd1a825026 Merge remote-tracking branch 'origin/stable-5.0'
* stable-5.0:
  Ensure that JSch knows HostKeyAlgorithms ssh-rsa and ssh-dss

Change-Id: I76899a1f6b3d9348d138266e05e1320b7429bfd1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-08-09 12:06:49 +02:00
Thomas Wolf 09753591fa Ensure that JSch knows HostKeyAlgorithms ssh-rsa and ssh-dss
Without these registrations, JSch's up-front checks which algorithms
are available at all fail if the ssh config explicitly sets only these
algorithms.

Bug: 537790
Change-Id: Idb0431190a7f101913363ee95af6c8fcbda6c923
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-08-08 13:36:35 +02:00
Matthias Sohn cf6463bddc Fix API breakage introduced by da254106
Use org.eclipse.jgit.errors.CancelledException which is a subclass of
IOException instead of org.eclipse.jgit.api.errors.CanceledException in
order to avoid breaking API. We can reconsider this with the next major
version 6.0.

Bug: 536324
Change-Id: Ia6f84f59aa6b7d78b8fccaba24ade320a54f7458
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-08-08 11:44:55 +02:00
Matthias Sohn da254106a7 Abort rename detection in a timely manner if cancelled
If progress monitor is cancelled break loops in rename detection by
throwing a CanceledException.

Bug: 536324
Change-Id: Ia3511fb749d2a5d45005e72c156b874ab7a0da26
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-07 00:09:43 +02:00
Jonathan Nieder 26c5d0e56a RebaseCommand: Remove unnecessary fall through comments
It's easier to read a list of cases

	case A:
	case B:
	case C:
		... do something ...;
		break;

without intervening "// fall through" lines separating the cases.

This also makes it clearer that JGit uses "$FALL-THROUGH$", not "fall
through", to suppress fallthrough warnings in switch statements.
Eclipse does not pay attention to the second comment style.

Change-Id: I5279a727aee2868854d06bfcaac8cb8186b4299e
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-08-04 14:04:29 -07:00
Matthias Sohn 2d1038c1a1 Merge branch 'stable-5.0'
* stable-5.0:
  Prepare 5.0.3-SNAPSHOT builds
  JGit v5.0.2.201807311906-r
  Prepare 4.11.2-SNAPSHOT builds
  JGit v4.11.1.201807311124-r
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: Ic8a748dbd02187fd783478b702c5795d88e7fe20
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-01 02:02:05 +02:00
Matthias Sohn 2f7bf6b536 Prepare 5.0.3-SNAPSHOT builds
Change-Id: Iae9d763a65481b09af6e19b33e41375f27038357
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-01 01:30:05 +02:00
Matthias Sohn 40813388e7 JGit v5.0.2.201807311906-r
Change-Id: Iccb98c03a069fee85a52325e1ed22cba8b76bcd8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-01 01:06:30 +02:00
Matthias Sohn a7c099ffa9 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.2-SNAPSHOT builds
  JGit v4.11.1.201807311124-r
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: I8c8ecc818205e1f5d94c02b463792ea1d72d8ba1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-08-01 00:57:07 +02:00
Matthias Sohn a8c7c42ff1 Prepare 4.11.2-SNAPSHOT builds
Change-Id: I02630900ab131478b30abe68b2133d2c8a5a67ab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-31 22:07:17 +02:00
Matthias Sohn e51d2fcda8 JGit v4.11.1.201807311124-r
Change-Id: Ic58a916d7e2c380b84690afa5e3517c6c178af8c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-31 17:31:30 +02:00
Matthias Sohn 95a8c3a8f7 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: I5f73f240951733e8d81d634aa5340a0861936a0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-31 17:21:19 +02:00
Matthias Sohn 0b6566e5ea Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: Ifd4b815b0f66d44afeafa9ae77a2a714942d675d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-31 17:11:29 +02:00
Matthias Sohn 6a813c64ff Prepare 4.9.4-SNAPSHOT builds
Change-Id: Ibb2ee9d00d5d049f681e1abbb449656105e553a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-31 16:57:13 +02:00
Matthias Sohn 56b435a61c JGit v4.9.3.201807311005-r
Change-Id: I3f4f437649736c6a27e78d536344c7b31c8a0f65
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-31 16:05:49 +02:00
Jonathan Nieder 8ef7cd4df4 Merge "Use project names instead of paths for the submodule name" 2018-07-27 18:15:14 -04:00
Masaya Suzuki 6658f36768 Use project names instead of paths for the submodule name
Two submodules at the same path on different branches need not represent
the same repository, and two submodules at different paths can represent
the same one.

The C Git implementation uses the submodule name to internally manage
the submodule repositories under .git/modules. When a submodule
represents different repositories in different branches, it makes a
conflict inside .git/modules.

The current RepoCommand implementation uses submodule paths as the
submodule names. When the manifest file mounts different repositories to
the same path in different branches, this makes a situation described
above. To solve this issue, we can use the project name instead of
the path as the submodule name.

On the other hand, since repo v1.12.8~3^2 (repo: Support multiple
branches for the same project., 2013-10-11), a manifest file can mount
the same project to different paths. If we naively use the project
name as the submodule name, it makes a conflict in .git/modules, too.

This patch uses the project name as the submodule name basically, but
when the same project is mounted to different paths, it uses the project
name and path as the submodule name.

Change-Id: I09dc7d62ba59016fe28852d3139a56ef7ef49b8f
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Reported-by: JP Sugarbroad <jpsugar@google.com>
2018-07-27 15:07:30 -07:00
Matthias Sohn 435975e7a9 Merge branch 'stable-5.0'
* stable-5.0:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I9717444c42ea89195dfcde8bb10121b9bb178e87
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 14:16:49 +02:00
Matthias Sohn 0db128acd5 Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I780d4a1624fbb97a2acdf5321b9c3244b0626444
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 14:06:22 +02:00
Matthias Sohn fd4a62fdf0 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I2b44d862869d4453c57db668fc7c925da591f671
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 13:38:21 +02:00
Matthias Sohn 8b97c266c3 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: Ie7029bc91621af32e7bfd2e0d76a424b991b1995
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 11:03:24 +02:00
Matthias Sohn a0b818ce01 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I6ab2b951dd94a9fc1c4f5283847a3e2ec37d0895
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-07-27 10:52:13 +02:00
David Pursehouse e90a013e45 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: Iadc8275fbaa3d6f7d08a96ab66d49f392f6aab78
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2018-07-27 08:22:51 +01:00