summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade eclipse-jarsigner-plugin to 1.1.6David Pursehouse2019-08-091-1/+1
| | | | | Change-Id: Iae7ebfe24bec19c0b56a325ab38384cdb05d3d90 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Upgrade Spotbugs to 3.1.12.2David Pursehouse2019-08-091-1/+1
| | | | | Change-Id: I4d673e058317e90b3de63f68202e580c0573f925 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Upgrade maven-site-plugin to 3.8.2Marco Miller2019-08-091-1/+1
| | | | | | Change-Id: I79a3032e2ff7af14a41e6eb2618d2b1e22d1fde2 Signed-off-by: Marco Miller <marco.miller@ericsson.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge changes from topic 'sshd'David Pursehouse2019-08-076-7/+228
|\ | | | | | | | | | | | | * changes: sshd: add missing javadoc in SshTestGitServer sshd: shared reference in JGitClientSession must be volatile sshd: correct the protocol version exchange
| * sshd: add missing javadoc in SshTestGitServerThomas Wolf2019-07-151-0/+10
| | | | | | | | Change-Id: Ie2e207eb05e0f6da8018153f8a5dd636e8f35f4c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * sshd: shared reference in JGitClientSession must be volatileThomas Wolf2019-07-151-1/+1
| | | | | | | | | | | | | | The proxy handler may be re-set from an unspecified I/O thread. Declare the shared variable as volatile. Change-Id: I4e7ce393ae2cdc7f1cd4edf40c137da6d6c50ad5 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * sshd: correct the protocol version exchangeThomas Wolf2019-07-156-6/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 4253 section 4.2 allows an ssh server to send additional lines before its server identification string. Apache MINA sshd enforces for these lines the constraints specified for the server identification line, too: no NUL characters and not longer than 255 characters. That is too strict. RFC 4253 doesn't mandate this, and it also doesn't make sense given the rationale for these lines in RFC 4253: a TCP wrapper may not be aware of SSH restrictions, and may not adhere to these constraints. Be more lenient when parsing the server's protocol version. Allow NULs and longer lines in the preamble, and also handle line endings more leniently. Only enforce the restrictions for the actual server identification line. Bug: 545939 Change-Id: I75955e9d8a8daef7c04fc0f39539c2ee93514e1c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Merge "Constants for objects and info/{http-,}alternates"Jonathan Nieder2019-08-0213-24/+48
|\ \
| * | Constants for objects and info/{http-,}alternatesDavid Turner2019-08-0213-24/+48
| | | | | | | | | | | | | | | | | | | | | These are useful to avoid typos, and also for tab completion. Change-Id: I0f2d267e46b36bc40297c9657c447f3fd8b9f831 Signed-off-by: David Turner <dturner@twosigma.com>
* | | UploadPack: move writing of "packfile" headerJonathan Tan2019-07-303-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a subsequent patch, in some cases, PackWriter#writePack will be responsible for both the "packfile-uris" and "packfile" sections, meaning that (in these cases) it must write the "packfile" section header itself. In preparation for that patch, move the writing of the "packfile" section header closer to the invocation of PackWriter#writePack when the entire fetch response is configured to use the sideband. This means that "packfile" is written *after* objects are counted (and progress messages sent to the client in sideband 2) when the "sideband-all" feature is used (whether "packfile-uris" is used or not), and written *before* objects are counted otherwise. Having code to write "packfile" in two places is unfortunate but necessary. When "sideband-all" is not used, object counting has to happen after "packfile" is written, because "packfile" activates the sideband that allows counting progress to be transmitted. When "packfile-uris" is used, object counting has to happen before "packfile" is written, because object counting determines whether to send "packfile-uris" or "packfile". When "sideband-all" is used but "packfile-uris" is not used, either way works; this commit uses "packfile-uris" behavior in this case. Also make the naming of the sideband-activating methods in PacketLineOut more consistent. Change-Id: Ifbfd26cc26af10c41b77758168833702d6983df1 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | Merge "JGit pgm tests must quote paths on the command line"David Pursehouse2019-07-254-20/+26
|\ \ \ | |/ / |/| |
| * | JGit pgm tests must quote paths on the command lineThomas Wolf2019-07-254-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The JGit pgm tests parse the command line internally using Linux semantics, treating '\' as an escape. File paths therefore must be quoted, otherwise Windows paths are destroyed. See the attachment[1] on bug 548598. [1] https://bugs.eclipse.org/bugs/attachment.cgi?id=279387 Bug: 544326 Change-Id: If42e29c8e808b0983fba2843a34c3ea3dd0e9246 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | PreUploadHookChain: Use list instead of array internallyIvan Frade2019-07-242-22/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newly introduced ProtocolV2HookChain is implemented using lists instead of arrays. Update PostUploadHookChain to keep the hook chains implementation consistent. Change-Id: I5ae0c923f117ac48558a989464f5d5d868d81f76 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | PostUploadHookChain: Use a list instead of array internallyIvan Frade2019-07-242-18/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newly introduced ProtocolV2HookChain is implemented using lists instead of arrays. Update PostUploadHookChain to keep hook chain implementations consistent. Change-Id: Ic5694feab943e8949896b93103dbf427716c9bd7 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | Merge "UploadPack: add getProtocolV2Hook() method"Jonathan Tan2019-07-241-0/+12
|\ \ \
| * | | UploadPack: add getProtocolV2Hook() methodIvan Frade2019-07-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A caller cannot install a second hook in the UploadPack without overwriting whatever is already there. Offer a method to get the current protocol v2 hook, so it can be chained with new hooks. Change-Id: Icb06f94ec52b8c8714f509b5b8622d6db42960fb Signed-off-by: Ivan Frade <ifrade@google.com>
* | | | Merge "ProtocolV2HookChain: Allow to create a chain of protocol V2 hooks"Jonathan Tan2019-07-242-0/+221
|\| | |
| * | | ProtocolV2HookChain: Allow to create a chain of protocol V2 hooksIvan Frade2019-07-182-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UploadPack only supports one protocol-v2 hook. There are already cases where more than one is needed. Offer a Chain class to compose ProtocolV2Hooks, as other hooks do. It looks like a single hook but it calls all its members. Change-Id: Idd173ca7df6672079ac0de03c67f77abac376538 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | | JschConfigSessionFactory: [findbugs] Set synchronizedMasaya Suzuki2019-07-221-1/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set synchronized to make the config access consistent. > Inconsistent synchronization of org.eclipse.jgit.transport.JschConfigSessionFactory.config; locked 80% of time In order to make JschConfigSessionFactory threadsafe, synchronize this method as well. Change-Id: I32d1bfc2e98363d254992144e795ce72fe1e8846 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | | Merge "UploadPackTest: use Consumer to set up UploadPack"Jonathan Tan2019-07-191-43/+70
|\ \ \ | |/ / |/| |
| * | UploadPackTest: use Consumer to set up UploadPackJonathan Tan2019-07-161-43/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a Consumer instead of several nullable variables to further configure UploadPack. This is in preparation for a test in a subsequent patch needing further customization of the UploadPack object before invoking it. Change-Id: I074dff92c711a5ba74558bb4b06c42c115fb9b7f Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | Upgrade maven-javadoc-plugin to 3.1.1David Pursehouse2019-07-171-1/+1
| | | | | | | | | | | | | | | Change-Id: If1681581798d1f8b314b506680a75ec7becc1241 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Upgrade ecj to 3.18.0David Pursehouse2019-07-171-1/+1
| | | | | | | | | | | | | | | Change-Id: I785fb9b32b7720c0552da6a6e8f2b7b810f4d3e2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Upgrade wagon-ssh to 3.3.3David Pursehouse2019-07-171-1/+1
|/ / | | | | | | | | Change-Id: I6f97dc478f4f62b2bf4a0667fb2dd8f8bdcf2707 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Support "sideband-all" in protocol v2 fetchJonathan Tan2019-07-167-4/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the client to specify "sideband-all" in a fetch v2 request, indicating that the whole response is to be multiplexed (with a sideband indicator on every non-flush and non-delim pkt) instead of only the packfile being multiplexed. This allows, for example, progress messages to be sent at any point in the response. This implements the "sideband-all" feature documented in Documentation/technical/protocol-v2.txt in Git. Change-Id: I3e7f21c88ff0982b1b7ebb09c9ad6c742c4483c8 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | UploadPack: remove pckOut instance fieldJonathan Tan2019-07-161-21/+28
| | | | | | | | | | | | | | | | It is difficult to track what's happening with the pckOut instance field, so replace it with a local variable in #upload instead. Change-Id: Ibd9225b28334b7133eccdc6d82b26fc96cbde299 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | UploadPackTest: refactor capability config testJonathan Tan2019-07-161-48/+59
|/ | | | | | | | | | | | | | | | UploadPackTest.java contains tests that check behavior when "allowfilter" and "allowrefinwant" are not set, are set, and are not set but the client insists on using them anyway. Because another capability is to be included in a subsequent patch, refactor the common code in these tests. Remove setBoolean calls with "false", as they are no-ops. Also take the opportunity to eliminate the overspecification of the "fetch=" line returned by the capability advertisement. Change-Id: I289bbd11c902a513cd8d53bc34767e61ebbd5f17 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* TreeRevFilter: Refresh code to latest coding standardsIvan Frade2019-07-121-19/+22
| | | | | | | | | | Use brackets in all "if" statements and remove the "final" from local variables and method arguments. https://wiki.eclipse.org/EGit/Contributor_Guide#Coding_standards Change-Id: I185f3112848fc1218cd7adb9828488f03fa4ddfc Signed-off-by: Ivan Frade <ifrade@google.com>
* Fix typos in JavadocMichael Keppler2019-07-083-6/+6
| | | | | Change-Id: I225e04aefd02e56a62e16f3db53fdda77d5e7253 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* Correct @since in RevWalk for the --first-parent methodsThomas Wolf2019-07-061-2/+6
| | | | | | | Fixes PDE API checks complaining: the methods were added in JGit 5.5.0. Change-Id: I9ff860c3408c6bb3891fa0da7547394d0fe9d0b6 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Move ServiceMayNotContinueException handling code from sendPackMasaya Suzuki2019-06-271-24/+22
| | | | | | | | All other exceptions are handled in a wrapped sendPack method. Consolidate the error handling code. Change-Id: Ieac0ce64960534d009d1e6b025130b021b744794 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* Move exception handling code to the callerMasaya Suzuki2019-06-272-71/+74
| | | | | | | | By doing this, exceptions thrown by sendPack are also covered by the same code. Change-Id: I3509f2d832af1410f307e931577e4d07e32b014e Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* Do not ignore secondary failureMasaya Suzuki2019-06-271-31/+22
| | | | | | | | | | When another exception is thrown while handling another exception, that exception can be attached to the original exception since Java 7 (Throwable#getSuppressed). Attach the secondary exception to the original exception instead of throwing it away. Change-Id: Ia093b8207714f2638e0343bc45a83d4342947505 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* Add assertThrowsMasaya Suzuki2019-06-272-154/+188
| | | | | | | | | | This is a new assertion that will be introduced in JUnit 4.13. Unlike ExpectedException rule, this makes it easy to test other aspects of the thrown exception, such like ServiceMayNotContinueException's status code. Introduce this as before making changes to UploadPackTest more. Change-Id: Ied7b3071ffcd0e93eece35b01e0abc5ff65645f2 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* RevWalk: Add a setFirstParent that mimics C git's --first-parentDave Borowitz2019-06-2720-32/+490
| | | | | | | | | | | | | RevWalk does not currently provide a --first-parent equivalent and the feature has been requested. Add a field to the RevWalk class to specify whether walks should traverse first parents only. Modify Generator implementations to support the feature. Change-Id: I4a9a0d5767f82141dcf6d08659d7cb77c585fae4 Signed-off-by: Dave Borowitz <dborowitz@google.com> Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
* UploadPack: support lazy fetches if no bitmapJonathan Tan2019-06-252-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | If a client clones with "--filter=blob:none", the checkout that "git clone" automatically does causes the client to fetch all blobs at HEAD. When fetching from a non-bitmapped repository, this will fail if an object walk is ever needed, because JGit currently rejects such requests - see the commit message of d3021788d2 ("Use bitmaps for non-commit reachability checks", 2017-11-10) for more information. Rejecting such requests in the absence of bitmaps is probably overzealous: it is true that the server would prefer to have bitmaps in this case, but there might be a small proportion of repos (for example, very small repos or newly created ones) that do not have bitmaps, yet the server would still like to have partial clones for them. So, allow such requests, performing the object walk reachability check if necessary. Limit this to servers with "uploadpack.allowFilter" configured, so that servers wanting to support partial clone have this functionality, and servers that do not support partial clone do not have to pay the object walk reachability check cost. Change-Id: I51964bafec68696a799625d627615b4f45ddbbbf Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* Fix bundle localization of Apache SSH bundleMichael Keppler2019-06-2140-73/+76
| | | | | | | | | The placeholders in manifest and plugin.properties did not match. To avoid similar issues, all placeholders have been changed to Bundle-Vendor and Bundle-Name now. Bug:548503 Change-Id: Ibd4b9bc237b323e614506b97e5fbc99416365040 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* Fix "reset -hard" bug that folders could not be deletedRené Scheibe2019-06-192-8/+20
| | | | | | | | | | | | The deleted code is not required as removed files are deleted correctly in doCheckout() anyway. The deleted code failed in case a non-empty directory had to be deleted. file.delete() returned false, triggering an exception. Bug: 479266 Change-Id: I011bb3882ff0c35b238aa3eccad7889041210277 Signed-off-by: René Scheibe <rene.scheibe@gmail.com>
* Fix "reset -hard" bug that folders could not be createdRené Scheibe2019-06-193-0/+42
| | | | | | | | | Creating a folder failed in case a file with the same name already existed. Bug: 479266 Change-Id: Ia987660ec0968ad4081dbd5a60e80660539497e3 Signed-off-by: René Scheibe <rene.scheibe@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Bazel: Fix lint warning flagged by buildifierDavid Ostrovsky2019-06-182-8/+8
| | | | | | | | | | | | | | | | | | | | This change is fixing confusing name warning: [1]. ./org.eclipse.jgit.test/tests.bzl:12: confusing-name: Never use 'l', 'I', or 'O' as names (they're too easily confused with 'I', 'l', or '0'). And is also fixing: "All calls to rules or macros should pass arguments by keyword position argument" warning: [2]. ./org.eclipse.jgit.test/BUILD:42: positional-args: All calls to rules or macros should pass arguments by keyword (arg_name=value) syntax. [1] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#confusing-name [2] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#positional-args Change-Id: If5c28ec8a1ddc1d1b1035bd07b838a2a564aea4f Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* Update bazlets to latest versionDavid Ostrovsky2019-06-181-1/+1
| | | | | | | | This is needed to make build tool chain compatible with the latest Bazel releases. Change-Id: I9822b5fe5f934457e6069217d687b3cf4764b7b7 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* [Java 11] Update mockito to 2.23.0Matthias Sohn2019-06-1810-61/+61
| | | | | | | | | | | | | | | This update is required for Java 11. Update - org.mockito to 2.23.0.v20190527-1420 - net.bytebuddy.byte-buddy to 1.9.0.v20181107-1410 - net.bytebuddy.byte-buddy-agent to 1.9.0.v20181106-1534 CQ: 20214 CQ: 20215 CQ: 20216 See: https://github.com/mockito/mockito/issues/1482 Change-Id: I3ac744f7247c71f01d50f7f409fee5825f3d5295 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [Java 9] Fix GitDateFormatterTestMatthias Sohn2019-06-181-4/+8
| | | | | | | | | | | | | In JDK 9 and later, the default locale data uses data derived from the Unicode Consortium's Common Locale Data Repository (CLDR). So there are changes with respect to some locales. For example the short date-time format is ‹{1}, {0}› in the CLDR locale, as opposed to {1} {0} in the JRE locale data. See: https://bugs.openjdk.java.net/browse/JDK-8206961 See: https://www.unicode.org/cldr/charts/29/by_type/date_&_time.gregorian.html#1141bf54834c4261 Change-Id: I7535821e8ecd8702a95db8732cbbf3a4a7385eca Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [Java 11] Remove dependency on javax.xml.bind packageDavid Ostrovsky2019-06-183-15/+3
| | | | | | | | | | Replace javax.xml.bind.DatatypeConverter, that is not available any more in Java 11 and later with Hex utility from non optional Bouncy Castle library. Bug: 540790 Change-Id: I9903c00ecc1a434e9795b8ba9267f02628fdc0e9 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* Merge "RebaseTodoFileTest: Fix "the the" typo"David Pursehouse2019-06-161-2/+2
|\
| * RebaseTodoFileTest: Fix "the the" typoIvan Frade2019-06-121-2/+2
| | | | | | | | | | | | | | Reported by downstream analyzers. Change-Id: I719bb2dd5b59390973dc2eb0d6854096e3768afb Signed-off-by: Ivan Frade <ifrade@google.com>
* | Ignore warning that tests don't export all packagesMatthias Sohn2019-06-167-0/+238
| | | | | | | | Change-Id: I95de23fbdce125305be08079bcd179413f8f7f5c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Ensure all packages are exportedMatthias Sohn2019-06-162-3/+4
| | | | | | | | | | | | | | | | This wasn't the case for the bundles - org.eclipse.jgit.ant - org.eclipse.jgit.archive Change-Id: Ibefcc82174fe23a9c1afb765099957414ac3556b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Delete unused API problem filtersMatthias Sohn2019-06-162-202/+0
| | | | | | | | Change-Id: Id8dcc337aab4ec6a11a2bb60b85d0db42986b80b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Walk tag chains for --include-tag optionsPavel Flaška2019-06-162-2/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cloning repository with --single-branch option, tag chains are not packed and pack file is broken in some cases. Typical test-case: git tag -a test_tag <commit-id> git tag -a test_prev_tag test_tag git tag -d test_tag git clone --single-branch <repository> fatal: did not receive expected object <test_tag_id> The reason for that is missing object for original test_tag reference, which was deleted. Problem description: When pack-objects is given --include-tag, it peels each tag reference down to a commit. If the commit is prepared to be packed, we we have to include such tag too. The problem is when the tag points to through some chain of other tag to commit. Then, the inner tags are not added leading to broken pack. Fix: When going to commit, we have to check and add any of the tags on the way (if they were not selected, which may happen with --single-branch option). Change-Id: I1682d4a2c52d674f90a1b021e0f6c3524c5ce5bc Signed-off-by: Pavel Flaška <Pavel.Flaska@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>