summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
Commit message (Collapse)AuthorAgeFilesLines
* UploadPack: Defer want-ref resolution to after parsingJonathan Nieder2018-12-261-30/+15
| | | | | | | | | | | | | | | | | ProtocolV2Parser explains: // TODO(ifrade): This validation should be done after the // protocol parsing. It is not a protocol problem asking for an // unexisting ref and we wouldn't need the ref database here. Do so. This way all ref database accesses are in one place, in the UploadPack class. No user-visible change intended --- this is just to make the code easier to manipulate. Change-Id: I68e87dff7b9a63ccc169bd0836e8e8baaf5d1048 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-5.0' into stable-5.1David Pursehouse2018-11-271-16/+39
|\ | | | | | | | | | | | | | | | | * stable-5.0: Fix DescribeCommand with multiple match options Fix git-describe tie-breakers Change-Id: I63e7a56bb617b5ce8774e1dc7f5efdde25e7cd97 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-4.11' into stable-5.0David Pursehouse2018-11-271-16/+39
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: Fix DescribeCommand with multiple match options Fix git-describe tie-breakers Change-Id: Ibb98f143ee0ce7635beb30ec404b4134a73788f6 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * Fix DescribeCommand with multiple match optionsMatthias Sohn2018-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when multiple match options are given in git describe the result must not depend on the order of the match options. JGit wrongly picked the first match using the match options in the order they were defined. Fix this by concatenating the streams of matching tags for all match options and then choosing the first match on the concatenated stream sorted in tie break order. See https://git-scm.com/docs/git-describe#git-describe---matchltpatterngt Change-Id: Id01433d35fa16fb4c30526605bee041ac1d954b2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Fix git-describe tie-breakersHåvard Wall2018-11-091-15/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct behaviour as git 1.7.1.1 is to resolve tie-breakers to choose the most recent tag. https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.1.1.txt: * "git describe" did not tie-break tags that point at the same commit correctly; newer ones are preferred by paying attention to the tagger date now. Bug: 538610 Change-Id: Ib0b2a301997bb7f75935baf7005473f4de952a64 Signed-off-by: Håvard Wall <haavardw@gmail.com>
* | | Merge branch 'stable-5.0' into stable-5.1Matthias Sohn2018-10-063-2/+210
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.0: Prepare 4.11.5-SNAPSHOT builds JGit v4.11.4.201810060650-r Fix configuration of maven-javadoc-plugin Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options * Fix todos in SubmoduleAddTest Change-Id: I53272081094b8948a40a1ce409af08b6ef330c1e Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge branch 'stable-4.11' into stable-5.0Matthias Sohn2018-10-063-2/+213
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: Prepare 4.11.5-SNAPSHOT builds JGit v4.11.4.201810060650-r Fix configuration of maven-javadoc-plugin Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options * Fix configuration of maven-javadoc-plugin for site generation Change-Id: Ic6ff8d324867ee41f15a5b890c7eee5092e8453e Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Merge branch 'stable-4.10' into stable-4.11Matthias Sohn2018-10-063-2/+213
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Ibd759f5d425f714e79b3137ff8e5b0f989933de0 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Merge branch 'stable-4.9' into stable-4.10Matthias Sohn2018-10-063-2/+213
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Prepare 4.9.7-SNAPSHOT builds JGit v4.9.6.201810051924-r Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Ie59e34eb591a827d1ce8e483eec6d390a3c81702 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * Merge branch 'stable-4.8' into stable-4.9Matthias Sohn2018-10-063-2/+213
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Ia7a826399d8d5b8a0eb7169b40e98a6f5c207a4c Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * Merge branch 'stable-4.7' into stable-4.8Matthias Sohn2018-10-063-3/+214
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.7: Prepare 4.7.6-SNAPSHOT builds JGit v4.7.5.201810051826-r BaseReceivePack: Validate incoming .gitmodules files ObjectChecker: Report .gitmodules files found in the pack SubmoduleAddCommand: Reject submodule URIs that look like cli options Change-Id: Id6fabec4d0b682a7e20a46e88cbc05432efca062 Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * BaseReceivePack: Validate incoming .gitmodules filesIvan Frade2018-10-051-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main concern are submodule urls starting with '-' that could pass as options to an unguarded tool. Pass through the parser the ids of blobs identified as .gitmodules files in the ObjectChecker. Load the blobs and parse/validate them in SubmoduleValidator. Change-Id: Ia0cc32ce020d288f995bf7bc68041fda36be1963 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * ObjectChecker: Report .gitmodules files found in the packIvan Frade2018-10-051-2/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to validate .gitmodules files, we first need to find them in the incoming pack. Do it in the ObjectChecker stage. Check in the tree objects if they point to a .gitmodules file and report the tree id and the .gitmodules blob id. This can be used later to check if the file is in the root of the project and if the contents are good. While we're here, make isMacHFSGit more accurate by detecting variants of filenames that vary in case. [jn: tweaked NTFS and HFS+ checking; added more tests] Change-Id: I70802e7d2c1374116149de4f89836b9498f39582 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * SubmoduleAddCommand: Reject submodule URIs that look like cli optionsIvan Frade2018-10-051-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C git versions before 2.19.1, the submodule is fetched by running "git clone <uri> <path>". A URI starting with "-" would be interpreted as an option, causing security problems. See CVE-2018-17456. Refuse to add submodules with URIs, names or paths starting with "-", that could be confused with command line arguments. [jn: backported to JGit 4.7.y, bringing portions of Masaya Suzuki's dotdot check code in v5.1.0.201808281540-m3~57 (Add API to specify the submodule name, 2018-07-12) along for the ride] Change-Id: I2607c3acc480b75ab2b13386fe2cac435839f017 Signed-off-by: Ivan Frade <ifrade@google.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | | | Merge branch 'stable-4.10' into stable-4.11Matthias Sohn2018-09-081-4/+5
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Fix atomic lock file creation on NFS Use constant for ".lock" Fix handling of option core.supportsAtomicCreateNewFile GC: Avoid logging errors when deleting non-empty folders Change-Id: Ie86079d9ad76972306bc80e63d8bfe18ae06a0da Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * | | | Merge branch 'stable-4.9' into stable-4.10Matthias Sohn2018-09-081-4/+5
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Fix atomic lock file creation on NFS Use constant for ".lock" Fix handling of option core.supportsAtomicCreateNewFile GC: Avoid logging errors when deleting non-empty folders Change-Id: I32dc651870b7ba7c88de448c7984134b7c99e7e3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * | | Merge branch 'stable-4.8' into stable-4.9Matthias Sohn2018-09-081-4/+5
| | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: Fix atomic lock file creation on NFS Use constant for ".lock" Fix handling of option core.supportsAtomicCreateNewFile GC: Avoid logging errors when deleting non-empty folders Change-Id: Id7f68f4e8fb07a21737e3b7090f600507a13bbbe Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * | Merge branch 'stable-4.7' into stable-4.8Matthias Sohn2018-09-081-4/+5
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.7: Fix atomic lock file creation on NFS Use constant for ".lock" Fix handling of option core.supportsAtomicCreateNewFile GC: Avoid logging errors when deleting non-empty folders Change-Id: Ia7a18f69eee173aec9e462c16eee2b0ca4565e76 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | | * Use constant for ".lock"Matthias Sohn2018-09-071-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 5f27032fb85694a093f827581216d4ffb99db68b) Change-Id: I6bc0e9a910b110418a82d8e574fb2aecc3a31d6a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * | Merge branch 'stable-4.7' into stable-4.8David Pursehouse2018-08-311-17/+0
| | | | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.7: Bazel: Use hyphen instead of underscore in external repository names Bazel: Format all build files with buildifier 0.15.0 ChangeIdUtilTest: Remove unused notestCommitDashV Change-Id: I414ade902dc38b696c566dd604000e3d289f3973 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | | * ChangeIdUtilTest: Remove unused notestCommitDashVDavid Pursehouse2018-08-301-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test was never being run. Since it was introduced it was named "notest.." which meant it didn't run with JUnit3, and since it is not annotated @Test it also doesn't run with JUnit4. When compiling with Bazel 0.6.0, error-prone raises an error that the public method is not annotated with @Ignore or @Test. Given that the test has never been run anyway, we can just remove it. Bug: 525415 Change-Id: Ie9a54f89fe42e0c201f547ff54ff1d419ce37864 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | UploadPackTest: Avoid unnecessarily boxing int into IntegerDavid Pursehouse2018-09-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The statement: assertThat(recvStream.available(), is(0)); results in a warning from Eclipse: The expression of type int is boxed into Integer because recvStream.available() returns int, but the hamcrest is() method takes an Integer. Replace it with the equivalent JUnit assertion. Also remove the suppression of another similar warning and fix that in the same way. Change-Id: I6f18b304a540bcd0a10aec7d3abc7dc6f047fe80 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | Parse signature of GPG-signed commitsDavid Turner2018-09-042-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support GPG-signed commits, add some methods which will allow GPG signatures to be parsed out of RevCommit objects. Later, we can add code to verify the signatures. Change-Id: Ifcf6b3ac79115c15d3ec4b4eaed07315534d09ac Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8David Pursehouse2018-09-0435-222/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3b748620f067582afef20f144feebe40d0332be2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | Simplify file creation in ResetCommandTestRené Scheibe2018-09-031-38/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use existing test utility methods instead of nested PrintWriter usage. Change-Id: I324852c7971ae644fa499f377a31d1cf265c7fd9 Signed-off-by: René Scheibe <rene.scheibe@gmail.com>
* | | | | | | Specify charset when constructing InputStreamReaderDavid Pursehouse2018-09-023-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ErrorProne warns [1] about implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations. [1] http://errorprone.info/bugpattern/DefaultCharset Change-Id: I0fd489d352170339c3867355cd24324dfdbd4b59 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | Merge "Replace useminimalnegotation flag with maxhaves flag"Jonathan Nieder2018-08-311-18/+4
|\ \ \ \ \ \ \
| * | | | | | | Replace useminimalnegotation flag with maxhaves flagMinh Thai2018-08-311-18/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Client will stop sending haves when the number of haves sent reaches maxhaves. Change-Id: I1e5b1525be4c67f20a81ca24a2770c20eb5c1271 Signed-off-by: Minh Thai <mthai@google.com>
* | | | | | | | Extract protocol v2 fetch request parsing to its own classIvan Frade2018-08-311-0/+336
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parsing code for protocol v2 fetch doesn't have any dependency on the rest of UploadPack. Move it to its own class. This makes testing easier (no need to instantiate the full UploadPack), simplifies the code in UploadPack and increases modularity. At the moment, the parser needs to know about the reference database to validate incoming references. This dependency could be easily removed moving the validation later in the flow, after the parsing, where other validations are already happening. Postponing that to keep this patch about moving unmodified code around. Change-Id: I7ad29a6b99caa7c12c06f5a7f30ab6a5f6e44dc7 Signed-off-by: Ivan Frade <ifrade@google.com>
* | | | | | | UploadPack: avoid conflating shallow commit lists in protocol v2Ivan Frade2018-08-301-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment there are two copies of the client shallow commit list: one in the request and another in the clientShallowCommits member of the class. The verifyShallowCommit function was removing missing object ids from the member but not the request list, and code afterwards was using the request's version. In practice, this didn't cause trouble because these shallow commits are used as endpoint for a walk, and missing ids are just never reached. Change-Id: I70a8f1fd46de135da09f16e5d954693c8438ffcb Signed-off-by: Ivan Frade <ifrade@google.com>
* | | | | | | Merge "Cleanup existing tests"Christian Halstrick2018-08-271-15/+13
|\ \ \ \ \ \ \
| * | | | | | | Cleanup existing testsRené Scheibe2018-08-241-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed and restructured tests for improved clarity. Bug: 479266 Change-Id: Ic9d05ddf722bddd148fa9d9c19248dd53d97f1e4 Signed-off-by: René Scheibe <rene.scheibe@gmail.com>
* | | | | | | | Merge branch 'stable-5.0'Matthias Sohn2018-08-251-0/+159
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| / / / / / / | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.0: Silence API warning for new ObjectIdSerializer introduced in 4.11.1 Ignore API warnings Fix photon target platform to use photon version of org.eclipse.osgi Update Photon orbit repository to R20180606145124 Suppress warning for trying to delete non-empty directory Fix fetching with duplicate ref updates Fetch(Process): should tolerate duplicate refspecs FetchCommandTest: test add/update/delete fetch Change-Id: I9e7fa37b100a7ea3cbe4104802d36c6f38df9e08 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | | Merge branch 'stable-4.11' into stable-5.0Matthias Sohn2018-08-251-0/+159
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: Silence API warning for new ObjectIdSerializer introduced in 4.11.1 Ignore API warnings Fix photon target platform to use photon version of org.eclipse.osgi Update Photon orbit repository to R20180606145124 Suppress warning for trying to delete non-empty directory Fix fetching with duplicate ref updates Fetch(Process): should tolerate duplicate refspecs FetchCommandTest: test add/update/delete fetch Change-Id: I2497f99b7d0686a0e0f773c39c8725e813ce9d4a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | | | Merge branch 'stable-4.10' into stable-4.11Matthias Sohn2018-08-251-0/+159
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Ignore API warnings Fix photon target platform to use photon version of org.eclipse.osgi Update Photon orbit repository to R20180606145124 Suppress warning for trying to delete non-empty directory Fix fetching with duplicate ref updates Fetch(Process): should tolerate duplicate refspecs FetchCommandTest: test add/update/delete fetch Change-Id: I47671108574fcd10fe016a58e38c038af54a6748 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * | | | Merge branch 'stable-4.9' into stable-4.10Matthias Sohn2018-08-241-0/+159
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Ignore API warnings Fix photon target platform to use photon version of org.eclipse.osgi Update Photon orbit repository to R20180606145124 Suppress warning for trying to delete non-empty directory Fix fetching with duplicate ref updates Fetch(Process): should tolerate duplicate refspecs FetchCommandTest: test add/update/delete fetch Change-Id: I2a83c059b7014c2a9e6267c963422c7785b23f17 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * | | Fix fetching with duplicate ref updatesThomas Wolf2018-08-221-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If packed refs are used, duplicate updates result in an exception because JGit tries to lock the same lock file twice. With non-atomic ref updates, this used to work, since the same ref would simply be locked and updated twice in succession. Let's be more lenient in this case and remove duplicates before trying to do the ref updates. Silently skip duplicate updates for the same ref, if they both would update the ref to the same object ID. (If they don't, behavior is undefined anyway, and we still throw an exception.) Add a test that results in a duplicate ref update for a tag. Bug: 529400 Change-Id: Ide97f20b219646ac24c22e28de0c194a29cb62a5 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| | | | * | | Fetch(Process): should tolerate duplicate refspecsMarc Strapetz2018-08-221-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 529314 Change-Id: I91eaeda8a988d4786908fba6de00478cfc47a2a2 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| | | | * | | FetchCommandTest: test add/update/delete fetchMarc Strapetz2018-08-221-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2442394fb7eae5b3715779555477dd27b274ee83 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | refactor: simplify collection.toArray()Michael Keppler2018-08-232-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On recent VMs, collection.toArray(new T[0]) is faster than collection.toArray(new T[collection.size()]). Since it is also more readable, it should now be the preferred way of collection to array conversion. https://shipilev.net/blog/2016/arrays-wisdom-ancients/ Change-Id: I80388532fb4b2b0663ee1fe8baa94f5df55c8442 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* | | | | | | Merge "Support remove-project node in the manifest parser"Jonathan Nieder2018-08-201-0/+26
|\ \ \ \ \ \ \
| * | | | | | | Support remove-project node in the manifest parserMasaya Suzuki2018-08-201-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This directive removes the projects added by other directives. https://gerrit.googlesource.com/git-repo/+/65b0ba5aa0447f7ee25103828115662b1eb80ff9/manifest_xml.py#614 https://gerrit.googlesource.com/git-repo/+/e469a0c741832f6584513f4a382d6b93f417b8d2/docs/manifest-format.txt#339 Change-Id: I90d7b9fc711b586dec05f475422d34d67d909986 Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
* | | | | | | | SubmoduleDeinitTest fails on WindowsAndrey Loskutov2018-08-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 538068 Change-Id: I982e8b12936582e8e119f45d7a3bf4888d3e0e1a Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | | | | | | | FilterCommandsTest fails on WindowsAndrey Loskutov2018-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 538068 Change-Id: I3ba6fceef2c34cacc0c37150206379aa93b5e3d0 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | | | | | | | ReceivePackAdvertiseRefsHookTest.testSuccess() fails on WindowsAndrey Loskutov2018-08-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | Introduce ProtocolV2HookMasaya Suzuki2018-08-161-15/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | Respond with shallow-info before wanted-refsJonathan Tan2018-08-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | Merge "Fix ResolveMerger: rebase with autocrlf=true, direct checkout"Gunnar Wagenknecht2018-08-132-1/+40
|\ \ \ \ \ \ \ \
| * | | | | | | | Fix ResolveMerger: rebase with autocrlf=true, direct checkoutThomas Wolf2018-08-132-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | | Support protocol v2 want-ref in UploadPackJonathan Tan2018-08-101-0/+219
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>