aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* pgm: Add missing dependency on commons-loggingJonathan Nieder2018-10-012-1/+1
| | | | | | | Without this, commands like "jgit repo" that use commons-logging fail. Change-Id: Ia78198c5e15ac4d6152d832ab2a2498f625486d2 Signed-off-by: Jonathan Nieder <jrn@google.com>
* Override int read(byte[], int, int) on test instances of InputStreamDavid Pursehouse2018-10-012-0/+11
| | | | | | | | | | This probably doesn't provide any benefit for the tests, but gets rid of a warning from Error Prone. See https://errorprone.info/bugpattern/InputStreamSlowMultibyteRead Change-Id: I584d2e0d18475fad38747b688af6301c423f54a7 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LfsFactory#LfsInputStream: Override int read(byte[], int, int)David Pursehouse2018-10-011-0/+5
| | | | | | | | | | | | | According to Error Prone, the class should also override: int read(byte[], int, int) otherwise multi-byte reads from this input stream are likely to be slow. See https://errorprone.info/bugpattern/InputStreamSlowMultibyteRead Change-Id: I33ab8cd30013447f2a0363b3a7b1424b79cb1818 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* MergeFormatterPass: Remove constructor taking charset name as stringJonathan Nieder2018-09-302-26/+1
| | | | | | | | Since this constructor is package-private, so instead of deprecating it, we can remove it right away. Change-Id: I84ba72e8c94fb09412bbf7ce73b7eec72f61e964 Signed-off-by: Jonathan Nieder <jrn@google.com>
* TextBuiltin#init: Factor out a method to get the log output encodingDavid Pursehouse2018-09-301-11/+22
| | | | | Change-Id: I87c5774722bd36ea6fe18c4b7ce22342578fa290 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ConfigConstants: Add constants for i18n.logOutputEncodingDavid Pursehouse2018-09-302-2/+19
| | | | | Change-Id: I6073c7fc8ec30840e2ee2e90ac4cfdb136f48b9a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Bazel: Increase severity of DefaultCharset to ERRORDavid Pursehouse2018-09-301-1/+1
| | | | | | | | | All existing instances of this issue have been fixed in preceding commits. Increase its severity to ERROR so that it is easier to detect reoccurences. Change-Id: I50f95152857baac5ca44c15493f23b6f9cfac1bf Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Explicitly specify charset when constructing PrintWriterDavid Pursehouse2018-09-305-42/+51
| | | | | Change-Id: Ie1631784b5eba04edb21f66df284f9e279fd2ec0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* TextBuiltin: Default to UTF-8 when i18n.logOutputEncoding is not setDavid Pursehouse2018-09-301-25/+25
| | | | | Change-Id: I69d82086c052b7ba601e0daab133573ec37c25cf Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* SidebandInputStream: Specify charset when calling String.getBytes()David Pursehouse2018-09-301-1/+1
| | | | | Change-Id: I96c3f6b2ef3db9619bb3ae46dfbf8bcff3c1cbca Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* MergeFormatter{Pass}: Use Charset instead of StringDavid Pursehouse2018-09-305-12/+118
| | | | | | | | Deprecate constructors and methods taking a character set name as a String, in favor of new variants taking a Charset. Change-Id: I616c601daf232fa17610dba1087fd902030d46ea Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Deprecate Constants.CHARACTER_ENCODING in favor of StandardCharsets.UTF_8David Pursehouse2018-09-3020-53/+61
| | | | | Change-Id: I621ba174235a6fb56236e54d24bce704bb5afb28 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Bazel: Increase severity of MissingFail to ERRORDavid Pursehouse2018-09-301-1/+1
| | | | | | | | | All instances of this potential bug have been cleaned up in preceding commits. Increase the severity to ERROR so that it is easier to detect reoccurences. Change-Id: I25beebcea1f01f468e0f2b1d24a83511029c077c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* TestProtocolTest: Add missing calls to fail()David Pursehouse2018-09-301-0/+3
| | | | | | | | | | | Error Prone reports: Not calling fail() when expecting an exception masks bugs See https://errorprone.info/bugpattern/MissingFail Change-Id: I58ad45a87dcf7d646dce056d20776d62faafbfef Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* BlockListTest: Add missing calls to fail()David Pursehouse2018-09-291-0/+13
| | | | | | | | | | | Error Prone reports: Not calling fail() when expecting an exception masks bugs See https://errorprone.info/bugpattern/MissingFail Change-Id: I518b524de7cd3802f03b80450cad02ab3f79d57b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DirCacheBuilderTest#testBuildRejectsUnsetFileMode: Add missing fail()David Pursehouse2018-09-291-0/+1
| | | | | | | | | | | Error Prone reports: Not calling fail() when expecting an exception masks bugs See https://errorprone.info/bugpattern/MissingFail Change-Id: Ic89f9daef3c31bfbfd1f3c003cb90a373cd74847 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DirCacheCheckoutTest#testCheckoutHierarchy: Add missing call to fail()David Pursehouse2018-09-291-0/+1
| | | | | | | | | | | Error Prone reports: Not calling fail() when expecting an exception masks bugs See https://errorprone.info/bugpattern/MissingFail Change-Id: I463510342bb6e6b99b31a0fe264d953340784393 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ConfigTest: Fix tests for getting empty config value as intDavid Pursehouse2018-09-291-10/+2
| | | | | | | | | | | | | | | | | | | | | | | The tests were set up to expect an IllegalArgumentException when the Config.getInt method was called with a section.key that has not been set, or explicitly set to an empty string. However, the IllegalArgumentException never gets thrown because the getInt method returns the provided default ("1"), and because there was no call to "fail" after getInt, the incorrect behavior of the test was not noticed. Remove the try/catch around getInt, and instead assert that the expected default value is returned. Found by Error Prone, which reported: Not calling fail() when expecting an exception masks bugs See https://errorprone.info/bugpattern/MissingFail Change-Id: Ie8e692aba9fb8523241fb8f298d57493923d9f78 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* FileResolverTest#testNotAGitRepository: Fail when exception is not thrownDavid Pursehouse2018-09-291-0/+1
| | | | | | | | | | | Error Prone reports: Not calling fail() when expecting an exception masks bugs See https://errorprone.info/bugpattern/MissingFail Change-Id: I9ac844aa6c5a620d9b5d21d2e242347b3788b96a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* UploadPack: support deepen-since in protocol v2Jonathan Tan2018-09-274-12/+130
| | | | | | | | | | | | | | | | | | Support the deepen-since parameter when requested by a client using protocol v2. This is done by: - adding a DepthWalk.RevWalk#setDeepenSince method - updating DepthGenerator to recognize when deepen-since is set - recording in DepthWalk.Commit whether a commit is a boundary commit Existing users of DepthWalk such as UploadPack previously recognized boundary commits by comparing their depths against the threshold, not tracking whether any parents were truly excluded. This behavior is preserved - UploadPack considers a commit as boundary if its depth is equal to the threshold *or* a parent was excluded (whether by depth or by deepen-since). Change-Id: I852bba6b1279f9cc8aee38282e9339d62b8dcddc Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* DepthGenerator: remove redundant depth checkJonathan Tan2018-09-271-2/+1
| | | | | | | | | | | | | | In DepthGenerator, commits are always added to the "pending" queue either at depth 0 (in the constructor) or after a depth check (in next()), so it is redundant to check for depth after removing them from the queue. Remove the check. This redundancy seems to have been present since the introduction of server-side shallow clone support in commit 9952223e06 ("Implement server support for shallow clones", 2011-08-21). Change-Id: Iad334935293367400c2901a25c0f4bf36c437cf2 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* FileRepositoryBuilderTest: Don't explicitly close BufferedWriter in ↵David Pursehouse2018-09-271-35/+34
| | | | | | | | | | | | | | | try-with-resource The BufferedWriter is opened in a try-with-resource and thus will be automatically closed. Presumably the close was added to make sure it is closed before the subsequent test statements are executed. Instead of explicitly closing it, let the try-with-resource automatically close it, and move the subsequent statements out of the try-block. Change-Id: If5fada2f580ef9cbaad3a0b9216b5200b917781a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Explicitly specify charset when constructing FileWriterDavid Pursehouse2018-09-263-14/+27
| | | | | | | | | | | Replace explicit construction of FileWriter with calls to the utility method Files.newBufferedWriter, which allows to specify the charset. Also convert to try-with-resource. Change-Id: I9fa3f612b9b2fc5ac12cd79d6e61ca181120dbf5 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Explicitly specify charset when constructing BufferedReaderDavid Pursehouse2018-09-262-32/+33
| | | | | | | | | Replace explicit construction of BufferedReader with calls to the utility method Files.newBufferedReader, which allows to specify the charset. Change-Id: I61b9451dbc8d9cf83fc8a5981292b8fdc713ce37 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Explicitly specify charset in constructor of InputStreamReaderDavid Pursehouse2018-09-265-10/+25
| | | | | Change-Id: Id43e27c590f41f7435c2ca1d127f27e45745da7f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Explicitly specify charset when calling getBytesDavid Pursehouse2018-09-2614-77/+90
| | | | | Change-Id: Ie492406005be56ccaf4dfb385ae376636404816d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Explicitly specify charset in constructor of StringDavid Pursehouse2018-09-266-26/+37
| | | | | Change-Id: Ie9a9f917503019e7fa51ccbc11a5a3518b74434b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Make inner classes static where possibleDavid Pursehouse2018-09-2612-14/+15
| | | | | | | | | | | | | As reported by Error Prone: An inner class should be static unless it references members of its enclosing class. An inner class that is made non-static unnecessarily uses more memory and does not make the intent of the class clear. See https://errorprone.info/bugpattern/ClassCanBeStatic Change-Id: Ib99d120532630dba63cf400cc1c61c318286fc41 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Bazel: Increase severity of ExpectedExceptionChecker to ERRORDavid Pursehouse2018-09-261-1/+1
| | | | | | | | | Incorrect usage of ExpectedException has been cleaned up in the preceding commits. Increase the severity from WARN to ERROR so that it is easier to catch any reoccurences. Change-Id: I57decf620b37e85413bda53723f839c02b488f2c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge branch 'stable-5.1'David Pursehouse2018-09-261-0/+4
|\ | | | | | | | | | | | | | | * stable-5.1: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Ie0b2b4aa4e5629d57b8104b64298d33de76abd82 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * Merge branch 'stable-5.0' into stable-5.1David Pursehouse2018-09-261-0/+4
| |\ | | | | | | | | | | | | | | | | | | | | | * stable-5.0: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Ie7cb0c8a9775626cf2a2daae04b2d1f73a6c5af7 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | * Merge branch 'stable-4.11' into stable-5.0David Pursehouse2018-09-261-0/+4
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.11: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Icacfa8dcd1ced32715fb772c336574318f28ddd1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | * Merge branch 'stable-4.10' into stable-4.11David Pursehouse2018-09-261-0/+4
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: I2ab21595531bcd487ce6a5cb0a3bc3c6f6f6e518 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | * Merge branch 'stable-4.9' into stable-4.10David Pursehouse2018-09-261-0/+4
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: I3dff04d2ea99e5b6331e45e3ea2ccc78fb2d5a02 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | * Merge branch 'stable-4.8' into stable-4.9David Pursehouse2018-09-261-0/+4
| | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Ie3de769209ec8477c97df5f90b8c63c03e023be0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | | * Merge branch 'stable-4.7' into stable-4.8David Pursehouse2018-09-261-0/+4
| | | | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.7: ObjectDownloadListener#onWritePossible: Add comment on return statement Change-Id: Id0833112b0be4e78af375ee1fc78287743d7bc4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| | | | | | | * ObjectDownloadListener#onWritePossible: Add comment on return statementDavid Ostrovsky2018-09-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not obvious why this return statement is needed. Clarify with a comment that otherwise endless loop may show up when recent versions of Jetty are used. Change-Id: I8e5d4de51869fb1179bf599bfb81bcd7d745874b Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* | | | | | | | Update .mailmapMatthias Sohn2018-09-251-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .mailmap file is used to map author and committer names and email addresses to canonical real names and email addresses. See https://git-scm.com/docs/git-check-mailmap Change-Id: I720326ad204bd0737e8ace2620ccbd1347114ef4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Fix @since tag on RefDatabase#getRefsByPrefixMatthias Sohn2018-09-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ic1615e680a131ef178c62c4ea92d2b389a0afd2b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | T0003_BasicTest: Fix incorrect usage of ExpectedExceptionDavid Pursehouse2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There should only be one statement after the expect(...) method. Any additional statements after the statement that is expected to throw will never be executed in a passing test. This can lead to inappropriately passing tests where later incorrect assertions are skipped by the thrown exception. See https://errorprone.info/bugpattern/ExpectedExceptionChecker Change-Id: I20fecf8fb7a243e9da097e6d03fbf8cd69151bf0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | ProtocolV2ParserTest: Fix incorrect usage of ExpectedExceptionDavid Pursehouse2018-09-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There should only be one statement after the expect(...) method. Any additional statements after the statement that is expected to throw will never be executed in a passing test. This can lead to inappropriately passing tests where later incorrect assertions are skipped by the thrown exception. See https://errorprone.info/bugpattern/ExpectedExceptionChecker Change-Id: I0d6350fafb281b6bdb04289f4cd5eb4bb159628b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Using getRefsByPrefix with multiple prefixesMinh Thai2018-09-242-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I9901e733797bd661f2485cc42914ad01699617d3 Signed-off-by: Minh Thai <mthai@google.com>
* | | | | | | | Query references by multiple prefixesMinh Thai2018-09-242-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support multiple prefixes when querying references to allow implementor to minimize number of RPC calls. Change-Id: I5f822fd7eaf9756b44750080d3056de138b64f4a Signed-off-by: Minh Thai <mthai@google.com>
* | | | | | | | Fix Mylyn commit message templateMichael Keppler2018-09-2325-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit message template contains a superfluous blank at the end of the first line, which is deleted by this change. This is only relevant for jgit contributors using Eclipse, not for jgit users. Change-Id: I462deb49c26fb64b3dc2d1d75f1e40ef302b0fc9 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
* | | | | | | | Bazel: Provide toolchain with activated error prone warningsDavid Ostrovsky2018-09-221-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On recent bazel versions it's trivial to apply package specific checks. Provide custom java toolchain with all error prone warnings activated. The list of all error prone warnings was borrowed from here: [1]. Test Plan: $ bazel build --java_toolchain //tools:error_prone_warnings_toolchain \ //... [1] https://github.com/bazelbuild/BUILD_file_generator/blob/master/tools/bazel_defs/java.bzl Change-Id: I207a368555bfb7ddab8d782d46d563ce779a6211 Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | | | Config.set-methods should not touch lines from included filesMarc Strapetz2018-09-202-17/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 538270 Change-Id: I4128213e83e267eb2667f451b8fb3301dd251656 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* | | | | | | | Don't inline included configs on FileBasedConfig.save()Marc Strapetz2018-09-202-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 529825 Change-Id: Id23d4602aa2082d7f2dfe15ae92d7b175b1b8944 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* | | | | | | | ConfigLine.includedFrom stores source, if it was read from included fileMarc Strapetz2018-09-202-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a base change which prepares for subsequent bugfixes. Change-Id: Iaadc93df37e45753d700be73669e68c03590adb5 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* | | | | | | | Merge branch 'stable-5.1'Matthias Sohn2018-09-180-0/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-5.1: Prepare 5.1.2-SNAPSHOT builds JGit v5.1.1.201809181055-r Prepare 4.11.4-SNAPSHOT builds JGit v4.11.3.201809181037-r Prepare 4.9.6-SNAPSHOT builds JGit v4.9.5.201809180939-r Prepare 4.7.5-SNAPSHOT builds JGit v4.7.4.201809180905-r Update API problem filter Change-Id: I50466bd95ac88a5a8f03ef52d9a59be46b13f81e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | | | Prepare 5.1.2-SNAPSHOT buildsMatthias Sohn2018-09-1856-357/+357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I095d246e27de747a234bc058725454c222be51ce Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>