aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Enable and fix "Statement unnecessarily nested within else clause" warningsDavid Pursehouse2019-10-17122-742/+663
| | | | | | | | | | | | | | | Since [1] the gerrit project includes jgit as a submodule, and has this warning enabled, resulting in 100s of warnings in the console. Also enable the warning here, and fix them. At the same time, add missing braces around adjacent and nearby one-line blocks. [1] https://gerrit-review.googlesource.com/c/gerrit/+/227897 Change-Id: I81df3fc7ed6eedf6874ce1a3bedfa727a1897e4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Close RevWalks in testsThomas Wolf2019-10-167-380/+443
| | | | Change-Id: Id28804ace2572e8f659271660e78454a0d6ccc49 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Merge "reftable: split off generic code from DFS code"Jonathan Tan2019-10-165-372/+721
|\
| * reftable: split off generic code from DFS codeHan-Wen Nienhuys2019-10-165-372/+721
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces ReftableBatchRefUpdate and ReftableDatabase, as generic classes, with some code moved to DfsReftableBatchRefUpdate and DfsReftableDatabase. Clarify thread-safety requirements by asserting locked status in accessors, and acquiring locks in callers. This does not fix threading problems, because ReftableBatchRefUpdate already wraps the whole transaction in a lock. This also fixes a number of bugs in ReftableBatchRefUpdate: * non-atomic updates should not bail on first failure * isNameConflicting should also check for conflicts between names that are added and removed in the BatchRefUpdate. Change-Id: I5ec91173ea9a0aa19da444c8c0b2e0f4e8f88798 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "reftable: fix lookup by ID in merged reftables"Jonathan Tan2019-10-162-1/+50
|\ \
| * | reftable: fix lookup by ID in merged reftablesHan-Wen Nienhuys2019-10-162-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On changing a ref, the old SHA1 is not updated in the object => ref mapping. This means search by object ID may still turn up a ref from deeper within the stack. To fix this, check all refs produced by the merged iterator against the merged reftables. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I41e9cd395b0608eedeeaead0a9fd997238d747c9
* | | Merge changes I6e022e4a,If1b9d808David Pursehouse2019-10-1520-916/+1041
|\ \ \ | | | | | | | | | | | | | | | | | | | | * changes: Close TreeWalks in tests Close SubmoduleWalks in tests
| * | | Close TreeWalks in testsThomas Wolf2019-10-1511-600/+689
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that TreeWalk.forPath() needs not be closed; the ObjectReader _is_ closed when that method returns. Change-Id: I6e022e4a2fde0c88d610a82de092ea541b33f75c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * | | Close SubmoduleWalks in testsThomas Wolf2019-10-159-316/+352
| | | | | | | | | | | | | | | | Change-Id: If1b9d80830b6b136d4ab33f5c7043b140bd92f85 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | Merge "IndexDiff: close SubmoduleWalk and use already loaded DirCache"Christian Halstrick2019-10-151-54/+58
|\| | |
| * | | IndexDiff: close SubmoduleWalk and use already loaded DirCacheThomas Wolf2019-10-151-54/+58
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the SubModuleWalk isn't closed its TreeWalk's ObjectReader won't be closed. Re-loading the DirCache during an IndexDiff is not only inefficient but could also give strange results if an external process had modified the index in the meantime: file diffs would be based on a "before" state, but submodule diffs on an "after" state. Change-Id: Iab948c08ac342138b37263c9028d80b84101f6d6 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | ProtocolV2Parser: Introduce advertise sideband-all optionIvan Frade2019-10-153-4/+19
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flag enabling sideband-all is used in two places: in UploadPack for advertisement and in the protocol parser to read it from the request. This leds to problems in distributed deployments where the two requests of a fetch can go to different servers with different configurations. Use the existing allowsidebandall to accept the sideband-all request (and respond to it) and introduce a new "advertisesidebandall" to toggle the advertising of the feature. Change-Id: I892d541bc3f321606c89bad1d333b079dce6b5fa Signed-off-by: Ivan Frade <ifrade@google.com>
* | DfsPackFile: Remove unused parameter from loadReverseIdx methodDavid Pursehouse2019-10-141-2/+2
|/ | | | | Change-Id: I2373084c8b40ebd6f432806dddc8633a76938e80 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Silence API errors for new fields added to PackStatistics.AccumulatorMatthias Sohn2019-10-121-0/+17
| | | | | | These fields were added in a307c887. Change-Id: I9e80abdb6f48dc7bf72de683dcf3566d2dab611f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove unused API warning filtersMatthias Sohn2019-10-122-40/+0
| | | | Change-Id: I78262681e12079028752d8c144720ad0256c5707 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing @since tag to UploadPack#uploadWithExceptionPropagationMatthias Sohn2019-10-121-0/+1
| | | | | | This was missed in b8d9734c Change-Id: I4b9c1cf058eff16af725375047d743944e7f5db4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-5.5'David Pursehouse2019-10-121-1/+1
|\ | | | | | | | | | | | | | | * stable-5.5: Bazel: Bump bazel version to 1.0.0 Change-Id: I1dc833e8de7a0c54492ea847fb74971ecf438e51 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-5.4' into stable-5.5David Pursehouse2019-10-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Bazel: Bump bazel version to 1.0.0 Change-Id: I967ad9e0fa6f13c5217aafb8faedc4a7dfb37c58 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2019-10-121-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Bazel: Bump bazel version to 1.0.0 Change-Id: If07e2ff3281dc96bec206b68631d22be8fd4636a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2019-10-111-1/+1
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Bazel: Bump bazel version to 1.0.0 Change-Id: Ife26567c08ec053741c9db4ca8b5b2836044dcde Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2019-10-111-1/+1
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Bazel: Bump bazel version to 1.0.0 Change-Id: I067d8ebd15f35f139d86bc67473b42afac4f0f53
| | | | | * Bazel: Bump bazel version to 1.0.0David Pursehouse2019-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I607915af0556efe8b2fb640e9387029b755d1a7f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | CachedPackUriProvider: size should be a long (not an int)Ivan Frade2019-10-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5cd8b6376cdec59c5ead318edc5385da961511ec Signed-off-by: Ivan Frade <ifrade@google.com>
* | | | | | Merge changes from topic 'packfile-offloading-stats'Jonathan Tan2019-10-114-4/+51
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: PackWriter/Statistics: Report offloaded size CachedPackUriProvider: Add size to the pack information
| * | | | | | PackWriter/Statistics: Report offloaded sizeIvan Frade2019-10-112-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add to statistics the amount and size of packfiles offloaded to HTTP download. Change-Id: I895a7219ecac2794368bfc4fdfae74c1238deed9 Signed-off-by: Ivan Frade <ifrade@google.com>
| * | | | | | CachedPackUriProvider: Add size to the pack informationIvan Frade2019-10-112-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object identifying packfiles to send them via packfile-uri contains only the uri and the hash. This is the information that goes through the wire. It would be useful to know also the size of those packfile, for example to track how many bytes have been offloaded to HTTP. Add size field the CachedPackUriProvider.PackInfo object. Change-Id: If6b921b48a4764d936141c777879b148cc80bbd3 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | | | | | Merge "http: Allow specifying a custom error handler for UploadPack"Terry Parker2019-10-094-27/+119
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | http: Allow specifying a custom error handler for UploadPackMasaya Suzuki2019-10-094-27/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By abstracting the error handler, this lets a user customize the error handler for UploadPack. A customized error handler can show a custom error message to the clients based on the exception thrown from the hook, create a monitoring system for server errors, or do custom logging. Change-Id: Idd3b87d6bd471fef807c0cf1183e904b2886157e Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | | | | | | Merge changes Ieebbd671,I0e3e9456,Ia8d72e31Terry Parker2019-10-091-106/+122
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: UploadPack: Create a method that propagates an exception as-is UploadPack: Consolidate the sideband handling code to one place UploadPack: Introduce ErrorWriter
| * | | | | | UploadPack: Create a method that propagates an exception as-isMasaya Suzuki2019-10-091-34/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception handling can be isolated from UploadPack. This makes it possible to make the exception handler pluggable. Change-Id: Ieebbd6711963c7f2e47a98783b4ad815793721c7 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
| * | | | | | UploadPack: Consolidate the sideband handling code to one placeMasaya Suzuki2019-10-091-61/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This consolidates the sideband stream creation code and the error handling code for the sideband-allowed part in the Git protocol to one place. Change-Id: I0e3e94564f50d1be32006f9d8bcd1ef1ce6bf07e Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
| * | | | | | UploadPack: Introduce ErrorWriterMasaya Suzuki2019-10-091-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ErrorWriter writes an error message to the user. The implementation is swapped once it detects that the client supports sideband. By default it uses the protocol level ERR packet, which was introduced recently. In total the error output is done in two different places; UploadPack#upload and UploadPack#sendPack. These will be consolidated in the next change. Change-Id: Ia8d72e31170bbeafc8ffa8ddb92702196af8a587 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | | | | | | Apache HTTP: support proxy authenticationThomas Wolf2019-10-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a credentials provider that forwards to the java.net.Authenticator. Needed to support proxies requiring authentication. Bug: 549832 Change-Id: I181ee27a6c9f1b3fa402ce58affdd5ff3f7c96c9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | ProtocolV2Parser: Add missing $NON-NLS suppressionDavid Pursehouse2019-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If0a6eb9829a4790073f1c9baa2cfe39cb43f7d84 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | UploadPackTest: Stop using deprecated PacketLineIn constantsDavid Pursehouse2019-10-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DELIM and END constants are deprecated and using them causes warnings. Replace them with the accessor methods. Change-Id: Iadb27000755e8fd8c61d9218591f9d110b8265c8 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | Fix parsing of core.logAllRefUpdatesThomas Wolf2019-10-073-33/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also correctly parse the "always" value (allowed in canonical git since git 2.12.0[1]). Adapt the ReflogWriter. [1] https://github.com/git/git/commit/341fb2862 Bug: 551664 Change-Id: I051c76ca355a2ac8d6092de65f44b18bf9aeb125 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | Update Jetty to 9.4.21.v20190926Matthias Sohn2019-10-0422-205/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If01a01015024db9743c38c59f920964b3c3a0539 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | Create 4.14 staging target platformMatthias Sohn2019-10-045-10/+110
|/ / / / / / | | | | | | | | | | | | | | | | | | Change-Id: I6d8a6a0af41775a40342d56665cbd4e2e4aa5c61 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | Merge "Merge branch 'stable-5.5'"Matthias Sohn2019-10-041-4/+2
|\ \ \ \ \ \
| * | | | | | Merge branch 'stable-5.5'Matthias Sohn2019-10-031-4/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.5: Prepare 5.5.2-SNAPSHOT builds JGit v5.5.1.201910021850-r Prepare 5.3.7-SNAPSHOT builds JGit v5.3.6.201910020505-r Prepare 5.1.13-SNAPSHOT builds JGit v5.1.12.201910011832-r Do not rely on ArrayIndexOutOfBoundsException to detect end of input Change-Id: Iabebdc4786b52ec678caa798975428fda4ad7bd7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | | | Prepare 5.5.2-SNAPSHOT buildsMatthias Sohn2019-10-0373-452/+452
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ief9940182fd6e3f3e2df88e6485be753c1260e6b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | | | JGit v5.5.1.201910021850-rv5.5.1.201910021850-rMatthias Sohn2019-10-0373-104/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I9930b35b095f638119b4601a8311257daf5e5420 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | | | Merge branch 'stable-5.4' into stable-5.5Matthias Sohn2019-10-031-4/+2
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.4: Prepare 5.3.7-SNAPSHOT builds JGit v5.3.6.201910020505-r Prepare 5.1.13-SNAPSHOT builds JGit v5.1.12.201910011832-r Do not rely on ArrayIndexOutOfBoundsException to detect end of input Change-Id: Ia1070fd170651ce827bc6b876c6764a44ffe60eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * | | | Merge branch 'stable-5.3' into stable-5.4Matthias Sohn2019-10-021-4/+2
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.3: Prepare 5.3.7-SNAPSHOT builds JGit v5.3.6.201910020505-r Prepare 5.1.13-SNAPSHOT builds JGit v5.1.12.201910011832-r Do not rely on ArrayIndexOutOfBoundsException to detect end of input Change-Id: Ia621d06a9489ee276c793de9dd4a77f4ff19e2ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * | | Prepare 5.3.7-SNAPSHOT buildsMatthias Sohn2019-10-0268-427/+427
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3465b6a4d913bfb2864abba58448423e7c262f60 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * | | JGit v5.3.6.201910020505-rv5.3.6.201910020505-rMatthias Sohn2019-10-0268-89/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I12d1c6af03f2d7474c99c22cd2aabb77e95fcb32 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * | | Merge branch 'stable-5.2' into stable-5.3Matthias Sohn2019-10-021-4/+2
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.2: Prepare 5.1.13-SNAPSHOT builds JGit v5.1.12.201910011832-r Do not rely on ArrayIndexOutOfBoundsException to detect end of input Change-Id: I3f11a83e177daefa0a2e91173f70f9547067f713 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * | Merge branch 'stable-5.1' into stable-5.2Matthias Sohn2019-10-021-4/+2
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Matthias Sohn (2) and Saša Živkov (1) * stable-5.1: Prepare 5.1.13-SNAPSHOT builds JGit v5.1.12.201910011832-r Do not rely on ArrayIndexOutOfBoundsException to detect end of input Change-Id: Iaae4b171eaa0081f9142489de8df94ab455d65f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * Prepare 5.1.13-SNAPSHOT buildsMatthias Sohn2019-10-0256-359/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ic1dca14924f49ad07eb5cd0570ce7ece9f319d0d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * JGit v5.1.12.201910011832-rv5.1.12.201910011832-rMatthias Sohn2019-10-0256-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I69fef9b2cdc18bbf1c8b9b290fb3d190684be13c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>