summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | Use eclipse compiler in Maven buildMatthias Sohn2018-04-251-57/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found instructions for configuring maven-compiler-plugin with ecj in [1]. Verified that ecj run in this way raises build errors when executed on commit d3ef5213. Define profiles "ecj" for using Eclipse compiler and "javac" for using javac including errorprone. By default ecj will be used. use ecj: $ mvn -Pecj clean install use javac: $ mvn -Pjavac clean install TODO: find out how to run ecj with errorprone from Maven. [1] https://stackoverflow.com/questions/33164976/using-eclipse-java-compiler-ecj-in-maven-builds Change-Id: I716b603b57612b953e603387c82fd01eb1b5ca97 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Remove trivial cases of using deprecated RefDatabase.getRefs()Matthias Sohn2018-04-2520-54/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2d3e426a3391923f8a690ac68fcc33851f3eb419 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Suppress boxing warningMatthias Sohn2018-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I90226674320841774ad691c84609e3fe71bf7852 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Remove unnecessary semicolonMatthias Sohn2018-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3677ecb106ade209e756cec2c6f4232a416bfb44 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix non-externalized String warningsMatthias Sohn2018-04-255-46/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - suppress warning for non-translatable texts - externalize error messages Change-Id: Ieba42219b2c0b51a288f5a60438a6cc4f9dfe641 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Remove unused code and link to deprecated codeJonathan Tan2018-04-252-22/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eclipse reports these as errors, so remove them. Change-Id: Ic53d8003f9faef38fe776af5a73794e7bb1dfc49 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | | | | | | File compile and API errors in JGitMichael Keppler2018-04-251-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Photon throws null analysis errors on the repeated invocation of those previously null checked methods. Extract them to a local variable to avoid this. (the null analysis is configured in project properties) * setUseProtocolV2() misses @since tag. Problem was introduced with 332bc611249d21f9b604f2c0207bf0bdfbfc3a78. Might be caused by the long delay of 2 months from creation to merging. Change-Id: Ibbb1a1580b604b8e7cd4bf7edc4643e292b6b4a8 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* | | | | | | | Merge "Upgrade error_prone_core to 2.3.1"Matthias Sohn2018-04-231-2/+2
|\ \ \ \ \ \ \ \
| * | | | | | | | Upgrade error_prone_core to 2.3.1David Pursehouse2018-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and plexus-compiler-javac-errorprone to 2.8.4. Change-Id: I36487ce53e70b54d7a04292e666540224c107b43 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | | Teach UploadPack "no-progress" in "fetch"Jonathan Tan2018-04-232-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the "no-progress" parameter in the "fetch" command in the fetch-pack/upload-pack protocol v2. Change-Id: I6a6d6b1534f44845254b81d0e1f5c4ba2ac3d10b Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | | | | | | | Teach UploadPack "thin-pack" in "fetch"Jonathan Tan2018-04-232-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the "thin-pack" parameter in the "fetch" command in the fetch-pack/upload-pack protocol v2. Change-Id: I39a37b2b66a16929137d35c718a3acf2afb6b0b5 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | | | | | | | Teach UploadPack basic "fetch" commandJonathan Tan2018-04-233-12/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add basic support for the "fetch" command in the fetch-pack/upload-pack protocol v2. This patch teaches "have" and "done". The protocol specification (Documentation/technical/protocol-v2.txt in the Git project) states: want <oid> Indicates to the server an object which the client wants to retrieve. Wants can be anything and are not limited to advertised objects. It is unspecified whether the server should respect the uploadpack.allowtipsha1inwant option etc. when serving packfiles. This patch is conservative in that the server respects them. Change-Id: I3dbec172239712ef9286a15b8407e86b87ea7863 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | | | | | | | Teach UploadPack "ref-prefix" in "ls-refs"Jonathan Tan2018-04-232-3/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the "ref-prefix" parameter in the "ls-refs" command in the fetch-pack/upload-pack protocol v2. Change-Id: If9cf93b2646f75d50a11b5f482594f014d59a836 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | | | | | | | UploadPack: Don't buffer ls-refs outputJonathan Nieder2018-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once we have read the user's entire command, there is no more need to buffer our response --- even the strictest servlet engine allows writing output once the input has been consumed. Noticed when the analogous code in the "fetch" command (introduced in a later patch) overflowed its buffer: java.lang.OutOfMemoryError at java.io.ByteArrayOutputStream.hugeCapacity(ByteArrayOutputStream.java:123) [...] at org.eclipse.jgit.transport.UploadPack.sendPack(UploadPack.java:1905) at org.eclipse.jgit.transport.UploadPack.sendPack(UploadPack.java:1741) at org.eclipse.jgit.transport.UploadPack.fetchV2(UploadPack.java:1001) at org.eclipse.jgit.transport.UploadPack.serviceV2(UploadPack.java:1030) at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:726) at org.eclipse.jgit.http.server.UploadPackServlet.doPost(UploadPackServlet.java:195) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) Change-Id: I33df56f1cb1c6c2c25ee95426cb7ad665134ac6b
* | | | | | | | | Implement ls-refs in UploadPackJonathan Tan2018-04-234-1/+160
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement support for Git protocol v2's "ls-refs" command and its "symrefs" and "peel" parameters. This adds support for this command to UploadPack but the git://, ssh://, and git:// transports do not make use of it yet. That will have to wait for later patches. Change-Id: I8abc6bcc6ed4a88c165677ff1245625aca01267b Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | | | | | | | Implement protocol v2 with no capabilities in UploadPackJonathan Tan2018-04-203-3/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add initial support for protocol v2 of the fetch-pack/upload-pack protocol. This protocol is described in the Git project in "Documentation/technical/protocol-v2.txt". This patch adds support for protocol v2 (without any capabilities) to UploadPack. Adaptations of callers to make use of this support will come in subsequent patches. [jn: split from a larger patch; tweaked the API to make UploadPack handle parsing the extra parameters and config instead of requiring each caller to do such parsing] Change-Id: I79399fa0dce533fdc8c1dbb6756748818cee45b0 Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | | | | | | | PacketLineIn, PacketLineOut: Add support for delim-pktJonathan Tan2018-04-204-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most pkt-lines (data-pkts) have the form pkt-len pkt-payload where pkt-len is a string of 4 hexadecimal digits representing the size in bytes of the pkt-line. Since this size includes the size of the pkt-len, no data-pkt has a length less than 4. A pkt-line with a length field less than 4 can thus be used for other purposes. In Git protocol v1, the only such pkt-line was flush-pkt = "0000" which was used to mark the end of a stream. Protocol v2 (see Documentation/technical/protocol-v2.txt in git.git) introduces a second special pkt-line type: delim-pkt = "0001" used to mark the end of a section within a stream, for example to separate capabilities from the content of a command. [jn: split out from a larger patch that made use of this support] Change-Id: I10e7824fa24ed74c4f45624bd490bba978cf5c34 Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | | | | | | | Add RefDatabase#getRefsByPrefix methodJonathan Tan2018-04-202-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing RefDatabase#getRefs abstract method (to be implemented by ref database backends) has the following issues: - It returns a map with a key (the name of the ref with the prefix removed) which is potentially superfluous (it can be derived by the caller if need be) and confusing (in that the prefix is removed). - The prefix is required to end with a '/', but some backends (e.g. reftable) have fast search by prefix regardless of what the last character of the prefix is. Add a new method #getRefsByPrefix that does not have these issues. This is non-abstract with a default implementation that uses #getRefs (for backwards compatibility), but ref database backends can reimplement it. This also prepares for supporting "ref-prefix" in the "ls-refs" command in the fetch-pack/upload-pack protocol v2, which does not require that the prefix end with a '/'. Change-Id: I4c92f852e8c1558095dd460b5fd7b602c1d82df1 Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Jonathan Nieder <jrn@google.com>
* | | | | | | | Handle Gerrit Change-Ids for merge commitsThomas Wolf2018-04-182-15/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise successful, non-conflicting merges will never get a Gerrit Change-Id. Bug: 358206 Change-Id: I9b599ad01d9f7332200c1d81a1ba6ce5ef990ab5 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | PushProcess: Remove unused import of HashMapDavid Pursehouse2018-04-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 533621 Change-Id: Ie125818d5fc8fef5800108db2ca21151d8d3bfa3 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Configure WindowCache settings to use in JGit CLIMatthias Sohn2018-04-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the same defaults as in EGit. Use mmap to map git packfiles into memory. Change-Id: I7997b9123448a762192d7eeb55e01432549fba98 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Merge "Push: Ensure ref updates are processed in input order"David Pursehouse2018-04-133-5/+64
|\ \ \ \ \ \ \ \
| * | | | | | | | Push: Ensure ref updates are processed in input orderDave Borowitz2018-04-133-5/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various places on the client side of the push were creating unordered maps and sets of ref names, resulting in ReceivePack processing commands in an order other than what the client provided. This is normally not problematic for clients, who don't typically care about the order in which ref updates are applied to the storage layer. However, it does make it difficult to write deterministic tests of ReceivePack or hooks whose output depends on the order in which commands are processed, for example if informational per-ref messages are written to a sideband.[1] Add a test that ensures the ordering of commands both internally in ReceivePack and in the output PushResult. [1] Real-world example: https://gerrit-review.googlesource.com/c/gerrit/+/171871/1/javatests/com/google/gerrit/acceptance/git/PushPermissionsIT.java#149 Change-Id: I7f1254b4ebf202d4dcfc8e59d7120427542d0d9e
* | | | | | | | | Merge "Allow '@' as last character of ref"Christian Halstrick2018-04-132-0/+4
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | |
| * | | | | | | | Allow '@' as last character of refChristian Halstrick2018-04-122-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously @ was allowed e.g. in branch names, but not as the last character. The case that @ is the last character was not handled. Change-Id: Ic33870b22236f7a5ec7b54007f1b0cefd9354bfb
* | | | | | | | | DirCache: Use constant from StandardCharsetsDavid Pursehouse2018-04-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of hard-coding the encoding name, use the constant from StandardCharsets. As a result it is no longer necessary to catch the UnsupportedEncodingException. Change-Id: I3cb6de921a78e05e2a894c220e0d5a5c85e172cc Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | | Use Constants.CHARACTER_ENCODING in testsDavid Pursehouse2018-04-112-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iba9fc991aee54fcb8b0dc5e5841da24c2d54dfc2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | | LargePackedWholeObject: Refactor to open DfsReader in try-with-resourceDavid Pursehouse2018-04-111-21/+15
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia9557e6c1ab230dbe2e94e025a49e93159d8658c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Don't throw if a pre-push hook is ignored.Markus Duft2018-04-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This breaks any scenario where native git (with LFS) clones a repository (and thus installs the hook) and later on JGit is used to push changes. Change-Id: I2a17753377265a0b612ba3451b9df63a577a1c38 Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
* | | | | | | | Merge branch 'stable-4.11'David Pursehouse2018-04-091-0/+4
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: LFS: Fix potential NPE in LfsPrePushHook Change-Id: If721bd18035870541d216d2dcd9d47484e9af3e5 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | | | | | | | LFS: Fix potential NPE in LfsPrePushHookMarkus Duft2018-04-041-0/+4
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NPE occurred in conjunction with a symbolic ref (origin/HEAD). Change-Id: I291636818a121ca00e0df25de5b6fc71a48d447f Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
* | | | | | | | Silence API error for ObjectIdSerializer.readWithoutMarker()Thomas Wolf2018-03-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I99111797253b04148c42c83e1ef3d2cc383cc627 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | Merge branch 'stable-4.11'Matthias Sohn2018-03-263-3/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: Remove package import for javax.servlet.http from org.eclipse.jgit Add missing @since tag and silence API error Change-Id: I2783a15ead26ab19de31a8fb3bfb148ef19de91a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | | | Remove package import for javax.servlet.http from org.eclipse.jgitMatthias Sohn2018-03-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This package import is unused. Change-Id: I9f202bb3162736a1ef8054516f1a3145d3a7bb9b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | | | Add missing @since tag and silence API errorMatthias Sohn2018-03-272-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods were introduced for 4.11.1 so we have to silence the API error adding API in a service release raises. Change-Id: Ic847cebbed439912d3979ec2ec1809f77a28f61e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Significantly speed up FileTreeIterator on WindowsThomas Wolf2018-03-255-16/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Getting attributes of files on Windows is an expensive operation. Windows stores file attributes in the directory, so they are basically available "for free" when a directory is listed. The implementation of Java's Files.walkFileTree() takes advantage of that (at least in the OpenJDK implementation for Windows) and provides the attributes from the directory to a FileVisitor. Using Files.walkFileTree() with a maximum depth of 1 is thus a good approach on Windows to get both the file names and the attributes in one go. In my tests, this gives a significant speed-up of FileTreeIterator over the "normal" way: using File.listFiles() and then reading the attributes of each file individually. The speed-up is hard to quantify exactly, but in my tests I've observed consistently 30-40% for staging 500 files one after another, each individually, and up to 50% for individual TreeWalks with a FileTreeIterator. On Unix, this technique is detrimental. Unix stores file attributes differently, and getting attributes of individual files is not costly. On Unix, the old way of doing a listFiles() and getting individual attributes (both native operations) is about three times faster than using walkFileTree, which is implemented in Java. Therefore, move the operation to FS/FS_Win32 and call it from FileTreeIterator, so that we can have different implementations depending on the file system. A little performance test program is included as a JUnit test (to be run manually). While this does speed up things on Windows, it doesn't solve the basic problem of bug 532300: the iterator always gets the full directory listing and the attributes of all files, and the more files there are the longer that takes. Bug: 532300 Change-Id: Ic5facb871c725256c2324b0d97b95e6efc33282a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | | | TransportHttp: Refactor to use try-with-resource and suppress resource warningDavid Pursehouse2018-03-251-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I130269e7c5e46aea2152dea6b02539529208eea2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Add missing @since tags for new APIMatthias Sohn2018-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods were added after 4.11 so strictly speaking they violate semantic versioning since new API requires increasing the minor version number. Hence pretend these methods were introduced in 5.0 Change-Id: I7793ead16577dc1f2ddea09ba6b055103c783555 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix API problem filter warningsMatthias Sohn2018-03-253-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Silence warnings for bundles which haven't broken API since 4.11 but we increased major version to 5 since we always use the same version for all jgit bundles Change-Id: If4f9a6aa4ef21f9b511946c5fc4bd7c0af6094c4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Remove unused API problem filtersDavid Pursehouse2018-03-242-86/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I414ebba1db831686fd378dadcb7c4882eb323115 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | DfsInserter#openStream: Suppress resource warning about DfsReaderDavid Pursehouse2018-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DfsReader is not opened in a try-with-resource because in the case where the method returns an ObjectStream.Filter, the DfsReader should only be closed from within the Filter's close() method. Suppress the resource warning. Change-Id: Ifcaf5e4a326bd1d03c6331b476c645ca43943b34 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | CloneCommand: Suppress resource warning about RepositoryDavid Pursehouse2018-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repository is not opened in try-with-resource because it is wrapped in a Git instance which should be closed by the caller. On exeptions during fetch, it is explicitly closed in the catch blocks. Suppress the warning with an explanatory comment. Change-Id: Ib32c74ce39bb810077ab84db33002bdde806f3b6 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Rename RecursiveMergerTest and ResolveMergerTest to reduce confusionDavid Pursehouse2018-03-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The class names imply that RecursiveMergerTest tests the RecursiveMerger and ResolveMergerTest tests the ResolveMerger. In fact, both of them include coverage of both strategies; the difference is that RecursiveMergerTest is only testing criss-cross merges. The tests cannot be combined into a single class because the criss-cross test methods have additional data points. Instead, rename the classes to more meaningful names. Change-Id: I7ca8a03a3b7e351e2d4fcaca3b3186c098a3ca66 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | ResolveMergerTest: Use @DataPoints instead of @DataPointDavid Pursehouse2018-03-241-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define strategiesUnderTest as an array of MergeStrategy using the @DataPoints annotation, rather than two separate variables each annotated as @DataPoint. This makes the implementation consistent with RecursiveMergerTest. Change-Id: I9f1d525b38cb59634ba054c7779dc4af1fc46e25 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | SubmoduleSyncCommand: Refactor to open Repository in try-with-resourceDavid Pursehouse2018-03-241-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I502904ff7dbe074f7bbcb2a56a17bf4729f4f4d3 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | SubmoduleUpdateCommand: Refactor to open Repository in try-with-resourceDavid Pursehouse2018-03-241-30/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1a303fdfdb6823043fa6751c43eaeaf678f2e64f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | TransportGitAnon: Suppress resource warning about SocketDavid Pursehouse2018-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id1f5c0db4273324748a0ead2e6dac58d9114cf86 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | FS#runProcess: Fix OutputStream left unclosed after IOExceptionDavid Pursehouse2018-03-241-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The runProcess method creates an OutputStream that is not managed by a try-with-resource because it's manually closed and any IOException raised by the close() method is explicitly ignored. Suppress the resource warning with an explanatory comment. Enclose the call to StreamGobbler#copy in an inner try-block, and move the call to close() inside its finally block. This prevents the stream from being left unclosed if StreamGobbler#copy raises IOException. Change-Id: Idca9adfc4d87e0989d787ad8239c055c0c849814 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Merge changes from topic 'If72b4b422-cleanup'Jonathan Nieder2018-03-223-31/+32
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: UploadPackTest: Fix name hiding introduced by If72b4b422 Suppress non-localized string warnings introduced by If72b4b422
| * | | | | | | | UploadPackTest: Fix name hiding introduced by If72b4b422David Pursehouse2018-03-201-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The local variable 'remote' hides the class scope variable of the same name. Change-Id: I7410c33678677ce2a14691772466d91e8139e3fa Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>