]> source.dussan.org Git - jgit.git/log
jgit.git
6 years agoFileRepository: Open FileInputStream in try-with-resource 54/118754/1
David Pursehouse [Tue, 6 Mar 2018 08:18:23 +0000 (17:18 +0900)]
FileRepository: Open FileInputStream in try-with-resource

Change-Id: Ief8aa4834437d76f7e636598bf9861312475e64a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFileLfsServlet: Open PrintWriter in try-with-resource 53/118753/1
David Pursehouse [Tue, 6 Mar 2018 08:15:04 +0000 (17:15 +0900)]
FileLfsServlet: Open PrintWriter in try-with-resource

Change-Id: I6fa225e541c6d5c3dbf3d852a502f4e9c4f7d77e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFetchProcess: Open OutputStreamWriter in try-with-resource 52/118752/1
David Pursehouse [Tue, 6 Mar 2018 08:14:19 +0000 (17:14 +0900)]
FetchProcess: Open OutputStreamWriter in try-with-resource

Change-Id: Ide7768882a95f9e9706e50ca0774edd428dd07c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFS: Open TemporaryBuffer in try-with-resource 50/118750/1
David Pursehouse [Tue, 6 Mar 2018 07:58:12 +0000 (16:58 +0900)]
FS: Open TemporaryBuffer in try-with-resource

Change-Id: I52e048e491e838b7f762a5b5f4d148e91049877c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoEditListTest: Open InputStream in try-with-resource 49/118749/2
David Pursehouse [Tue, 6 Mar 2018 07:52:28 +0000 (16:52 +0900)]
EditListTest: Open InputStream in try-with-resource

Change-Id: Ib5b86e332ec674dec5460a9629d94d9f94c31c24
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoEGitPatchHistoryTest: Open BufferedReader in try-with-resource 48/118748/2
David Pursehouse [Tue, 6 Mar 2018 07:49:23 +0000 (16:49 +0900)]
EGitPatchHistoryTest: Open BufferedReader in try-with-resource

Change-Id: I74aede463c7b0a478a1e0e8b680c206d3964061d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoT0003_BasicTest: Use CommitBuilder.setEncoding(Charset) 47/118747/3
David Pursehouse [Tue, 6 Mar 2018 04:42:45 +0000 (13:42 +0900)]
T0003_BasicTest: Use CommitBuilder.setEncoding(Charset)

Change-Id: I1c4cdd4b856d715a204030d2de25ef91977186c2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoWalkEncryptionTest: Use StandardCharsets.UTF_8 46/118746/3
David Pursehouse [Tue, 6 Mar 2018 04:39:37 +0000 (13:39 +0900)]
WalkEncryptionTest: Use StandardCharsets.UTF_8

Change-Id: I6eb8a33be62c452c264fb0560b988144d80a41f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoGetTextTest: Use StandardCharsets constants instead of CharSet.forName 45/118745/3
David Pursehouse [Tue, 6 Mar 2018 04:37:09 +0000 (13:37 +0900)]
GetTextTest: Use StandardCharsets constants instead of CharSet.forName

Change-Id: I61d626495338a89c014187c38a1f6b49accf7af4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoEGitPatchHistoryTest: Set input stream encoding with constant 44/118744/3
David Pursehouse [Tue, 6 Mar 2018 04:34:31 +0000 (13:34 +0900)]
EGitPatchHistoryTest: Set input stream encoding with constant

Change-Id: Ieff9b1d07704e37c8d5616b220b015855a7cc624
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDirCacheIterator: Open InputStream in try-with-resource 43/118743/3
David Pursehouse [Tue, 6 Mar 2018 04:31:32 +0000 (13:31 +0900)]
DirCacheIterator: Open InputStream in try-with-resource

Change-Id: I05d2d1de9a3d39466a6880f6e8107da8681876b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDumbClientSmartServerTest: Open auto-closeable resources in try-with-resource 41/118741/3
David Pursehouse [Tue, 6 Mar 2018 01:49:58 +0000 (10:49 +0900)]
DumbClientSmartServerTest: Open auto-closeable resources in try-with-resource

Change-Id: I599c6e274fe80af7bfd2205f56f469c22d1dd3e0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDirCacheCheckoutTest: Open FileInputStream in try-with-resource 40/118740/3
David Pursehouse [Tue, 6 Mar 2018 01:44:23 +0000 (10:44 +0900)]
DirCacheCheckoutTest: Open FileInputStream in try-with-resource

Change-Id: I3ceef36803752a19a4d74910b4db26c01279fd99
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDiffFormatterReflowTest: Open InputStream in try-with-resource 38/118738/3
David Pursehouse [Tue, 6 Mar 2018 01:42:36 +0000 (10:42 +0900)]
DiffFormatterReflowTest: Open InputStream in try-with-resource

Change-Id: Id7f420a2eac57e59fa3feb04236df6f5f8d07f02
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge changes from topic 'try-with-resource'
David Pursehouse [Tue, 6 Mar 2018 07:55:50 +0000 (02:55 -0500)]
Merge changes from topic 'try-with-resource'

* changes:
  DiffCommand: Open DiffFormatter in try-with-resource
  DiffAlgorithms: Open Repository in try-with-resource
  DescribeCommandTest: Open FileWriter in try-with-resource
  CommitCommand: Open InputStream in try-with-resource
  DefaultNoteMerger: Open UnionInputStream in try-with-resource

6 years agoDiffCommand: Open DiffFormatter in try-with-resource 37/118737/1
David Pursehouse [Tue, 6 Mar 2018 01:40:35 +0000 (10:40 +0900)]
DiffCommand: Open DiffFormatter in try-with-resource

Change-Id: I22bd1062d64b01bb98cdaf612482538114624b7f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge "Silence API error raised for new CONFIG_SECTION_LFS constant"
David Pursehouse [Tue, 6 Mar 2018 00:53:55 +0000 (19:53 -0500)]
Merge "Silence API error raised for new CONFIG_SECTION_LFS constant"

6 years agoDiffAlgorithms: Open Repository in try-with-resource 33/118733/1
David Pursehouse [Tue, 6 Mar 2018 00:52:12 +0000 (09:52 +0900)]
DiffAlgorithms: Open Repository in try-with-resource

Change-Id: I67cb486283213f8aa964333533c55966518baa36
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDescribeCommandTest: Open FileWriter in try-with-resource 32/118732/1
David Pursehouse [Tue, 6 Mar 2018 00:49:16 +0000 (09:49 +0900)]
DescribeCommandTest: Open FileWriter in try-with-resource

Change-Id: Ida79bdae652faa88fbdb1b81e7e10b5019ff2c16
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCommitCommand: Open InputStream in try-with-resource 31/118731/1
David Pursehouse [Tue, 6 Mar 2018 00:48:19 +0000 (09:48 +0900)]
CommitCommand: Open InputStream in try-with-resource

Change-Id: I800a2afae17f84636cae593be7f07628fb8476c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDefaultNoteMerger: Open UnionInputStream in try-with-resource 30/118730/1
David Pursehouse [Tue, 6 Mar 2018 00:47:11 +0000 (09:47 +0900)]
DefaultNoteMerger: Open UnionInputStream in try-with-resource

Change-Id: I035aa89cdbf235992f41e752f49d735be4e5df0a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSilence API error raised for new CONFIG_SECTION_LFS constant 28/118728/1
Matthias Sohn [Mon, 5 Mar 2018 23:28:38 +0000 (00:28 +0100)]
Silence API error raised for new CONFIG_SECTION_LFS constant

Change-Id: I27e68d245c6b9c972ab9470c14d1f45d15d4c253
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoCommitCommandTest: Open Repository in try-with-resource 27/118727/1
David Pursehouse [Mon, 5 Mar 2018 23:24:28 +0000 (08:24 +0900)]
CommitCommandTest: Open Repository in try-with-resource

Change-Id: Id9961a120ef9f949f04fc95455fae06ba95d8031
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCommitAndLogCommandTest: Open PrintWriter in try-with-resource 26/118726/1
David Pursehouse [Mon, 5 Mar 2018 23:22:48 +0000 (08:22 +0900)]
CommitAndLogCommandTest: Open PrintWriter in try-with-resource

Change-Id: I0c7f07e27d1881d8856dac008110fcaa85c98fbb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCloneCommandTest: Open Repository in try-with-resource 24/118724/1
David Pursehouse [Mon, 5 Mar 2018 23:20:45 +0000 (08:20 +0900)]
CloneCommandTest: Open Repository in try-with-resource

Change-Id: Id09d2126fb17d84581f8637e83a75dfa2e85ebe8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAutoCRLFInputStreamTest: Open auto-closeable resources in try-with-resource 68/118668/1
David Pursehouse [Mon, 5 Mar 2018 11:59:31 +0000 (20:59 +0900)]
AutoCRLFInputStreamTest: Open auto-closeable resources in try-with-resource

Change-Id: I427ab43a82861f7bc69b104e29dc4360048aec4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCleanCommandTest: Open Repository in try-with-resource 67/118667/1
David Pursehouse [Mon, 5 Mar 2018 11:56:38 +0000 (20:56 +0900)]
CleanCommandTest: Open Repository in try-with-resource

Change-Id: If87cb729432ae711a2e7cfd08d288d7fec3f6de2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource 66/118666/1
David Pursehouse [Mon, 5 Mar 2018 11:55:20 +0000 (20:55 +0900)]
CGitVsJGitRandomIgnorePatternTest: Open OutputStream in try-with-resource

Change-Id: I08e27d0ee48dabd94a4eeb608508f815a3000ec9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoArchiveTest: Open auto-closeable resources in try-with-resource 64/118664/1
David Pursehouse [Mon, 5 Mar 2018 11:23:03 +0000 (20:23 +0900)]
ArchiveTest: Open auto-closeable resources in try-with-resource

Change-Id: If11017f21027b46c7a66e52e4bc0cc73f4fbdc07
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoArchiveCommand: Create archive output stream in try-with-resource 63/118663/1
David Pursehouse [Mon, 5 Mar 2018 11:19:25 +0000 (20:19 +0900)]
ArchiveCommand: Create archive output stream in try-with-resource

Change-Id: I72f4d303945275d400723aa17212b302e051dc15
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoApplyCommand: Open FileWriter in try-with-resource 62/118662/1
David Pursehouse [Mon, 5 Mar 2018 11:17:32 +0000 (20:17 +0900)]
ApplyCommand: Open FileWriter in try-with-resource

Change-Id: Ia473f74dc4608fc43edd57eda4f193c226e9004d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAmazonS3Client: Open Input/OutputStream in try-with-resource 59/118659/1
David Pursehouse [Mon, 5 Mar 2018 11:13:51 +0000 (20:13 +0900)]
AmazonS3Client: Open Input/OutputStream in try-with-resource

Change-Id: I32d4031159dff9005e839d0b53940431cba12beb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAmazonS3: Open InputStream/FileInputStream in try-with-resource 58/118658/1
David Pursehouse [Mon, 5 Mar 2018 11:11:59 +0000 (20:11 +0900)]
AmazonS3: Open InputStream/FileInputStream in try-with-resource

Change-Id: I71606e14d2b3cf085b8d1343c3858e7a729a173e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAdvertiseErrorTest: Open Transport in try-with-resource 57/118657/1
David Pursehouse [Mon, 5 Mar 2018 11:10:12 +0000 (20:10 +0900)]
AdvertiseErrorTest: Open Transport in try-with-resource

Change-Id: I78adec7baf82d1a0eedc10e90b6d4f20008a046d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAddCommandTest: Open PrintWriter in try-with-resource 56/118656/1
David Pursehouse [Mon, 5 Mar 2018 11:08:34 +0000 (20:08 +0900)]
AddCommandTest: Open PrintWriter in try-with-resource

Change-Id: I8ef769d12239447a20b670398293dbb64b90087d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFileBasedConfigTest: Open FileOutputStream in try-with-resource 34/118634/1
David Pursehouse [Mon, 5 Mar 2018 08:16:14 +0000 (17:16 +0900)]
FileBasedConfigTest: Open FileOutputStream in try-with-resource

Change-Id: Id4c49d4af30bcc5210d35630a8699574694060bb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoWalkRemoteObjectDatabase: Open auto-closeable resources in try-with-resource 33/118633/1
David Pursehouse [Mon, 5 Mar 2018 08:15:04 +0000 (17:15 +0900)]
WalkRemoteObjectDatabase: Open auto-closeable resources in try-with-resource

Change-Id: Ie4f67ca8cab1031089782f202588b08cc157dd79
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTransportSftp: Open BufferedReader in try-with-resource 32/118632/1
David Pursehouse [Mon, 5 Mar 2018 08:13:20 +0000 (17:13 +0900)]
TransportSftp: Open BufferedReader in try-with-resource

Change-Id: Iab94cce80c11a5edeaf8f377001408cc53707c04
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoReflogReaderTest: Open FileOutputStream in try-with-resource 29/118629/1
David Pursehouse [Mon, 5 Mar 2018 07:35:09 +0000 (16:35 +0900)]
ReflogReaderTest: Open FileOutputStream in try-with-resource

Change-Id: I09af22292cc4b615b40a820dbc054282bb0c76b8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoReflogReaderTest: Fix indentation 28/118628/1
David Pursehouse [Mon, 5 Mar 2018 07:33:42 +0000 (16:33 +0900)]
ReflogReaderTest: Fix indentation

Change-Id: I981dc14065ce435034d2072cff77e7efaa2c5573
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoReflogWriterTest: Open FileInputStream in try-with-resource 27/118627/1
David Pursehouse [Mon, 5 Mar 2018 07:30:36 +0000 (16:30 +0900)]
ReflogWriterTest: Open FileInputStream in try-with-resource

Change-Id: Ie111aead49d83d6acfbb89bb475ef6d3159b36c4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTransportHttp: Open auto-closeable resources in try-with-resource 26/118626/1
David Pursehouse [Mon, 5 Mar 2018 07:28:59 +0000 (16:28 +0900)]
TransportHttp: Open auto-closeable resources in try-with-resource

Change-Id: I2f713b79ff07f5759c189f384cd25adb9b9f5761
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRebaseCommandTest: Open BufferedReader in try-with-resource 25/118625/1
David Pursehouse [Mon, 5 Mar 2018 07:23:50 +0000 (16:23 +0900)]
RebaseCommandTest: Open BufferedReader in try-with-resource

Change-Id: If8d77431edfdaec4a49a3c4ffe66a99e6d31c682
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDirCacheCGitCompatabilityTest: Open BufferedReader in try-with-resource 24/118624/1
David Pursehouse [Mon, 5 Mar 2018 07:23:08 +0000 (16:23 +0900)]
DirCacheCGitCompatabilityTest: Open BufferedReader in try-with-resource

Change-Id: I0494eb475954927743174941a7d6c06d8431f57f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoLockFile: Open FileInputStream in try-with-resource 20/118620/1
David Pursehouse [Mon, 5 Mar 2018 02:03:21 +0000 (11:03 +0900)]
LockFile: Open FileInputStream in try-with-resource

Change-Id: I0784266814225428a6a0070d1653c465d268b342
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCheckoutCommandTest: Open FileInputStream in try-with-resource 19/118619/1
David Pursehouse [Mon, 5 Mar 2018 01:59:43 +0000 (10:59 +0900)]
CheckoutCommandTest: Open FileInputStream in try-with-resource

Change-Id: I972958373ceaf4c3ae756559ccbc341506d4e72d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSmudgeFilter: Fix Integer boxing warning 18/118618/1
David Pursehouse [Mon, 5 Mar 2018 01:57:41 +0000 (10:57 +0900)]
SmudgeFilter: Fix Integer boxing warning

Change-Id: Ic00bcd25b0808a58880a4433d76b3b5a6a4ee5c7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAdd ConfigConstants.CONFIG_SECTION_LFS 17/118617/1
David Pursehouse [Mon, 5 Mar 2018 01:53:12 +0000 (10:53 +0900)]
Add ConfigConstants.CONFIG_SECTION_LFS

DirCacheCheckout has a warning about non-localised string "lfs". Other
classes use org.eclipse.jgit.lfs.lib.Constants but that is not visible
to DirCacheCheckout.

Add a new constant in ConfigConstants and use that in DirCacheCheckout.

Replace existing uses of org.eclipse.jgit.lfs.lib.Constants.LFS with
the new constant, except where it is referring to the folder name.

Change-Id: I0f21b951babff9a2e579d68c4de0c62ee4bc23d4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoReturn this from InstallLfsCommand.setRepository() to allow chaining 08/118608/2
Matthias Sohn [Sun, 4 Mar 2018 20:26:33 +0000 (21:26 +0100)]
Return this from InstallLfsCommand.setRepository() to allow chaining

Change-Id: I105f1f62f2dcdb20a196361190e9c9fe368e8613
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpgrade spotbugs-maven-plugin to 3.1.2 23/118323/3
David Pursehouse [Wed, 28 Feb 2018 02:25:30 +0000 (11:25 +0900)]
Upgrade spotbugs-maven-plugin to 3.1.2

Change-Id: I01d8392ef8d20efd7f03590c82da017e2b53a043
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUpdate orbit to S20180302171354 (photon) and R20180206163158 (oxygen) 90/118590/1
Matthias Sohn [Sat, 3 Mar 2018 23:53:19 +0000 (00:53 +0100)]
Update orbit to S20180302171354 (photon) and R20180206163158 (oxygen)

Change-Id: I5b5e59581bfa00bb16e3b8e0af6e154ad6583bb9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoAdd|RemoveNoteComand: Reduce duplicated code 86/118486/2
David Pursehouse [Fri, 2 Mar 2018 05:14:55 +0000 (14:14 +0900)]
Add|RemoveNoteComand: Reduce duplicated code

The private method commitNoteMap is in both classes with the same
implementation.

Make it static in AddNoteCommand and reuse it from RemoveNoteCommand.

Change-Id: Ia037bf9efdd94ee7b8d33b41321e9cfd6ea4a6a5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoLFSPointerTest: Open ByteArrayOutputStream in try-with-resource 77/118477/2
David Pursehouse [Fri, 2 Mar 2018 02:10:00 +0000 (11:10 +0900)]
LFSPointerTest: Open ByteArrayOutputStream in try-with-resource

Change-Id: Ib15a838e735f8b960e0ed635d6d9b0caf97f4791
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAbbreviationTest: Open FileOutputStream in try-with-resource 76/118476/2
David Pursehouse [Fri, 2 Mar 2018 02:08:05 +0000 (11:08 +0900)]
AbbreviationTest: Open FileOutputStream in try-with-resource

Change-Id: Id1d48da466251f9e4186f4674afba4b5901a4388
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTagBuilder: Open OutputStreamWriter in try-with-resource 75/118475/2
David Pursehouse [Fri, 2 Mar 2018 02:04:27 +0000 (11:04 +0900)]
TagBuilder: Open OutputStreamWriter in try-with-resource

Change-Id: Ic0e23039b0aec6171f192234c6b1474cd32eadff
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDaemonService: Open Repository in try-with-resource 33/118233/3
David Pursehouse [Tue, 27 Feb 2018 05:21:36 +0000 (14:21 +0900)]
DaemonService: Open Repository in try-with-resource

Change-Id: I8deec91d91e82c7cb186cfa9507eb443dd87aad3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRefDirectory: Open BufferedReader in try-with-resource 32/118232/3
David Pursehouse [Tue, 27 Feb 2018 05:16:19 +0000 (14:16 +0900)]
RefDirectory: Open BufferedReader in try-with-resource

Change-Id: I9239df3e381b141b48ad7ea1b706e5b5927946cd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoObjectDirectory: Open BufferedReader in try-with-resource 31/118231/3
David Pursehouse [Tue, 27 Feb 2018 05:14:03 +0000 (14:14 +0900)]
ObjectDirectory: Open BufferedReader in try-with-resource

Change-Id: I4a44954c61647af1e48eade19112697e79297f2e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoPatch: Open TemporaryBuffer in try-with-resource 30/118230/3
David Pursehouse [Tue, 27 Feb 2018 05:12:10 +0000 (14:12 +0900)]
Patch: Open TemporaryBuffer in try-with-resource

Change-Id: I90bff8d49ecc37b8c10ce909cd3ac563205b641c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoEnable warning for resources not managed by try-with-resource 29/118229/3
David Pursehouse [Tue, 27 Feb 2018 05:10:41 +0000 (14:10 +0900)]
Enable warning for resources not managed by try-with-resource

Change-Id: Iefe97de6bdb62af558f1b0e77c9205a9186f9b4c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoLFS: Enable LFS support for the CLI, better error handling 64/112864/34
Markus Duft [Tue, 5 Dec 2017 10:16:30 +0000 (11:16 +0100)]
LFS: Enable LFS support for the CLI, better error handling

Enable LFS support for the CLI by registering the according filters.

Errors during filter creation must be propagated up the call stack, as a
failure to create a filter should be treated as fatal if the filter is
required.

Change-Id: I3833757839bdda97cd01b6c21c1613d199e2692d
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
6 years agoCleanup stream usage WRT filters 02/118502/3
Markus Duft [Fri, 2 Mar 2018 09:13:05 +0000 (10:13 +0100)]
Cleanup stream usage WRT filters

As it is right now some streams leak out of the filter construct. This
change clarifies responsibilities and fixes stream leaks

Change-Id: Ib9717d43a701a06a502434d64214d13a392de5ab
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoLFS: support merge/rebase/cherry-pick/diff/compare with LFS files 76/111376/43
Markus Duft [Fri, 2 Mar 2018 09:11:42 +0000 (10:11 +0100)]
LFS: support merge/rebase/cherry-pick/diff/compare with LFS files

Respect merge=lfs and diff=lfs attributes where required to replace (in
memory) the content of LFS pointers with the actual blob content from
the LFS storage (and vice versa when staging/merging).

Does not implement general support for merge/diff attributes for any
other use case apart from LFS.

Change-Id: Ibad8875de1e0bee8fe3a1dffb1add93111534cae
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge "LFS: Dramatically improve checkout speed with SSH authentication"
Matthias Sohn [Thu, 1 Mar 2018 14:16:55 +0000 (09:16 -0500)]
Merge "LFS: Dramatically improve checkout speed with SSH authentication"

6 years agoLFS: Dramatically improve checkout speed with SSH authentication 63/112863/30
Markus Duft [Tue, 5 Dec 2017 09:46:43 +0000 (10:46 +0100)]
LFS: Dramatically improve checkout speed with SSH authentication

SSH Authentication is quite expensive (~120ms on localhost against
Gerrit with LFS plugin). The SSH authentication typically also sends a
validity time of the returned token, which allows to re-use it for a
certain time, avoiding the expensive authentication on every download
request. This improves checkout times by large factors depending on the
LFS object amount/sizes.

Also make sure that all instances of Gson used by LFS are configured in
the same way.

Change-Id: I422c94c37021b4322789b3829fa0185e25d683f2
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
6 years agoCorrectly exit fetch negotiation for stateless RPC connections 89/118389/3
Terry Parker [Wed, 28 Feb 2018 23:10:23 +0000 (15:10 -0800)]
Correctly exit fetch negotiation for stateless RPC connections

Commit 9530c10192cf033c021802a3b295b06864654464 (2018-02-11)
"Add a minimum negotiation feature for fetch" made fetch
negotiation cheaper for repos with huge numbers of
references (we are seeing a 15x reduction in maximum fetch
times for chromium/chromium/src on trans-Pacific links).
But it inadvertently broke the handling of stateless RPC
connections, so fix that here.

Change-Id: I0090aa76ffecc55801ebb833ac2e0c933a4a7c54
Signed-off-by: Terry Parker <tparker@google.com>
6 years agoLFS: pre-push upload support 64/111364/31
Markus Duft [Fri, 10 Nov 2017 10:10:28 +0000 (11:10 +0100)]
LFS: pre-push upload support

If JGit built in LFS support is enabled for the current repository (or
user/system), any existing pre-push hook will cause an exception for the
time beeing, as only a single pre-push hook is supported.

Thus either native pre-push hooks OR JGit built-in LFS support may be
enabled currently, but not both.

Change-Id: Ie7d2b90e26e948d9cca3d05a7a19489488c75895
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoAmazonS3: Open OutputStream in try-with-resource 44/118144/1
David Pursehouse [Mon, 26 Feb 2018 11:38:12 +0000 (20:38 +0900)]
AmazonS3: Open OutputStream in try-with-resource

Change-Id: I0685a298a0f9fec465973cc718ae3bff373318a4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMergeGitAttributeTest: Open FileInputStream in try-with-resource 43/118143/1
David Pursehouse [Mon, 26 Feb 2018 08:48:42 +0000 (17:48 +0900)]
MergeGitAttributeTest: Open FileInputStream in try-with-resource

Change-Id: Iec85eea044c46a199b5b6f6bdbb3191d817dd441
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoPullCommandWithRebaseTest: Open File{Input|Output}Stream in try-with-resource 26/118126/2
David Pursehouse [Mon, 26 Feb 2018 08:42:38 +0000 (17:42 +0900)]
PullCommandWithRebaseTest: Open File{Input|Output}Stream in try-with-resource

Change-Id: I1ff707ab7bab676603907f4c0bb1bc495503055b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRecursiveMergerTest: Open FileOutputStream in try-with-resource 24/118124/1
David Pursehouse [Mon, 26 Feb 2018 08:39:57 +0000 (17:39 +0900)]
RecursiveMergerTest: Open FileOutputStream in try-with-resource

Change-Id: I158333d6393fb807bc21fba23fec7ad474384471
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoPullCommandTest: Use try-with-resources for File{Input,Output}Stream 21/118121/1
David Pursehouse [Sun, 25 Feb 2018 23:58:48 +0000 (08:58 +0900)]
PullCommandTest: Use try-with-resources for File{Input,Output}Stream

Change-Id: I09242eb289655c7554aefa9e0817d9b881db656b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAdd ObjectIdSerializer 31/117831/3
David Pursehouse [Wed, 21 Feb 2018 03:40:47 +0000 (12:40 +0900)]
Add ObjectIdSerializer

This is based on the ObjectIdSerialization class written by Shawn Pearce
for the Gerrit Code Review project in 2009 [1]. As mentioned in the
commit message there, it should be part of core JGit.

This implementation is slightly different to Shawn's version. Rather
than having separate methods for null/non-null ids, single methods are
implemented with @Nullable annotations.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/9792

Change-Id: I7599cf8bd1ecd546e2252783d6d672eb76804060
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoCheckoutCommandTest: Fix name of created temp file 05/118105/1
David Pursehouse [Sun, 25 Feb 2018 08:47:31 +0000 (17:47 +0900)]
CheckoutCommandTest: Fix name of created temp file

Change-Id: I29048f83aee3848679bbc6ded09dd3dd4a2ea35b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoIgnoreNodeTest: Suppress deprecation warnings in testEmptyIgnoreNode 04/118104/1
David Pursehouse [Sun, 25 Feb 2018 08:36:27 +0000 (17:36 +0900)]
IgnoreNodeTest: Suppress deprecation warnings in testEmptyIgnoreNode

Change-Id: I930c9408cc702af911419f2a7b3d03f652a2d4e3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFix warnings about boxing/unboxing Boolean 03/118103/1
David Pursehouse [Sun, 25 Feb 2018 08:35:00 +0000 (17:35 +0900)]
Fix warnings about boxing/unboxing Boolean

Change-Id: I9d81d510282e9181267750fe3f9c571c35b61407
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoWorkingTreeIterator: Fix warnings about variable hiding 02/118102/1
David Pursehouse [Sun, 25 Feb 2018 08:32:21 +0000 (17:32 +0900)]
WorkingTreeIterator: Fix warnings about variable hiding

Change-Id: I78ed3ae7aa30a7e7f146d0bd2e9feff74554da78
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoWorkingTreeIterator: Add NON-NLS suppressions 01/118101/1
David Pursehouse [Sun, 25 Feb 2018 08:30:03 +0000 (17:30 +0900)]
WorkingTreeIterator: Add NON-NLS suppressions

Change-Id: I369b8f68912134fc3880c162e9a2c5a1669bb4ac
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge "Fix processing of gitignore negations"
Matthias Sohn [Sat, 24 Feb 2018 00:42:03 +0000 (19:42 -0500)]
Merge "Fix processing of gitignore negations"

6 years agoFix processing of gitignore negations 86/117186/10
Marc Strapetz [Fri, 23 Feb 2018 12:34:23 +0000 (13:34 +0100)]
Fix processing of gitignore negations

Processing of negated rules, like !bin/ was not working correctly: they
were interpreted too broad, resulting in unexpected untracked files
which should actually be ignored

Bug: 409664
Change-Id: I0a422fd6607941461bf2175c9105a0311612efa0
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agoUpdate tycho to 1.1.0 03/118003/1
Michael Keppler [Fri, 23 Feb 2018 08:14:05 +0000 (09:14 +0100)]
Update tycho to 1.1.0

The upgrade was already done 3 weeks ago, this version number was
missing, however.

Change-Id: Ibc794ba8035c46ea2160925b344ded5714b7c987
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
6 years agoConfigure Semaphore used in TestRequestLog to be fair 09/117909/2
Matthias Sohn [Wed, 21 Feb 2018 21:50:04 +0000 (22:50 +0100)]
Configure Semaphore used in TestRequestLog to be fair

Bug: 528187
Change-Id: I26c94ad7f802fc1dbe72d63a7ea346dc6e19ff94
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix indentation in TestRequestLog 89/117989/1
Matthias Sohn [Thu, 22 Feb 2018 22:10:14 +0000 (23:10 +0100)]
Fix indentation in TestRequestLog

We use tabs to indent.

Change-Id: I19b00e06becfb92fbabb99b5699385506fd85214
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoDfsReaderIoStats: Clarify that "blocks" are really cache misses 64/115264/2
Dave Borowitz [Thu, 11 Jan 2018 18:14:02 +0000 (13:14 -0500)]
DfsReaderIoStats: Clarify that "blocks" are really cache misses

The previous wording was ambiguous as to whether these were blocks
requested from the cache (hits + misses) or read from underlying storage
(misses only).

They are in fact recording only misses:
Accumulator#{readBlock,readBlockBytes,readBlockMicros} are only
incremented from BlockBasedFile#readOneBlock, which is only called from
the cache miss path in DfsBlockCache#getOrLoad (line 391).

Change-Id: I0135cd1e76d09c1e28e0f1833b34c312511c66ce

6 years agoPathMatcher: fix handling of **/ 77/117477/12
Marc Strapetz [Sat, 17 Feb 2018 12:20:57 +0000 (13:20 +0100)]
PathMatcher: fix handling of **/

**/ should match only directories, but not files

Change-Id: I885c83e5912cac5bff338ba657faf6bb9ec94064
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agoMerge changes Id616611e,Ib6509e81,I52f5d3f2
David Pursehouse [Thu, 22 Feb 2018 05:37:48 +0000 (00:37 -0500)]
Merge changes Id616611e,Ib6509e81,I52f5d3f2

* changes:
  RepoCommand: generate relative submodule URLs from absolute URLs.
  RepoCommand: don't record new commit if tree did not change
  RepoCommand: persist unreadable submodules in .gitmodules

6 years agoCGitIgnoreTest: also test untracked files 83/117583/3
Marc Strapetz [Sat, 17 Feb 2018 12:20:46 +0000 (13:20 +0100)]
CGitIgnoreTest: also test untracked files

Change-Id: I21a4ebd63eaaa85aa2e68f99ef58c141189bdab4
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
6 years agodfs: Try to avoid searching UNREACHABLE_GARBAGE during packing 70/102770/5
Shawn Pearce [Wed, 9 Aug 2017 12:22:14 +0000 (05:22 -0700)]
dfs: Try to avoid searching UNREACHABLE_GARBAGE during packing

If an object can be found in a non-garbage pack, favor that pack over
paging in the garbage pack's idx and pack content.

Only fall back to garbage packs if an object cannot be found and there
are garbage packs present in the repository.  This fallback is
required to correct race conditions during GC.

Change-Id: Ia7c123975bc069b8e6e713eda2d357303b71e329

6 years agoRepoCommand: generate relative submodule URLs from absolute URLs. 88/117688/3
Han-Wen Nienhuys [Mon, 19 Feb 2018 18:59:35 +0000 (19:59 +0100)]
RepoCommand: generate relative submodule URLs from absolute URLs.

If a manifest file specifies an absolute URL on the same host on which
the superproject resides, rewrite the URLs to be relative.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: Id616611e5195998fb665c8e7806539a3a02e219a

6 years agoRepoCommand: don't record new commit if tree did not change 87/117387/4
Han-Wen Nienhuys [Wed, 14 Feb 2018 19:34:03 +0000 (20:34 +0100)]
RepoCommand: don't record new commit if tree did not change

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: Ib6509e816684256d723558d5e8f3c37de58a2ff8

6 years agoRepoCommand: persist unreadable submodules in .gitmodules 86/117386/5
Han-Wen Nienhuys [Wed, 14 Feb 2018 17:23:03 +0000 (18:23 +0100)]
RepoCommand: persist unreadable submodules in .gitmodules

In cases where a manifest file mixes different remotes, a Gerrit
server process may not have access to all remotes, and won't be able
to produce a full submodule tree.

Preserving this information in .gitmodules will let downstream clients
reconstruct the full tree.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I52f5d3f288e771dca0af2b4dd3f3fa0f940dcf15

6 years agoDeclare LFS dependency on GSON for Bazel build 37/117637/2
Han-Wen Nienhuys [Mon, 19 Feb 2018 09:42:14 +0000 (10:42 +0100)]
Declare LFS dependency on GSON for Bazel build

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: Ia017dd5651756c3b80f18b908fb28ba56b6cbf14

6 years agoSilence API error for new constant in ConfigConstants 25/117625/1
Matthias Sohn [Sun, 18 Feb 2018 21:23:00 +0000 (22:23 +0100)]
Silence API error for new constant in ConfigConstants

Change-Id: Ic4bd10b67caf6b2a2cc0c23bb4e7c717e4ccd6d5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoSilence API errors raised for new public fields in PackStatistics 24/117624/1
Matthias Sohn [Sun, 18 Feb 2018 21:08:39 +0000 (22:08 +0100)]
Silence API errors raised for new public fields in PackStatistics

Change-Id: I8e118282a833361b676aa3cc90cbe774ccd42ed0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoLFS: Add remote download to SmudgeFilter 06/83506/38
Markus Duft [Fri, 7 Oct 2016 10:39:45 +0000 (12:39 +0200)]
LFS: Add remote download to SmudgeFilter

Transfer data in chunks of 8k Transferring data byte per byte is slow,
running checkout with CleanFilter on a 2.9MB file takes 20 seconds.
Using a buffer of 8k shrinks this time to 70ms.

Also register the filter commands in a way that the native GIT LFS can
be used alongside with JGit.

Implements auto-discovery of LFS server URL when cloning from a Gerrit
LFS server.

Change-Id: I452a5aa177dcb346d92af08b27c2e35200f246fd
Also-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
6 years agoRepoCommand: Don't leave Git open 17/117317/7
David Pursehouse [Wed, 14 Feb 2018 01:30:12 +0000 (10:30 +0900)]
RepoCommand: Don't leave Git open

When the command is run on a non-bare repository, an instance of
Git is created to execute the commit, and is left open when the
command has finished.

Refactor to not use a class scope Git instance, and make sure it
gets closed before returning.

Change-Id: Ic623ae0fd8b9e264b5dfd434da0de6bb4f910984
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge "Merge branch 'stable-4.10'"
Matthias Sohn [Wed, 14 Feb 2018 23:18:43 +0000 (18:18 -0500)]
Merge "Merge branch 'stable-4.10'"

6 years agoMerge "InitCommand: Don't leave Repository open after Git is closed"
David Pursehouse [Wed, 14 Feb 2018 23:18:35 +0000 (18:18 -0500)]
Merge "InitCommand: Don't leave Repository open after Git is closed"

6 years agoMerge branch 'stable-4.10' 03/117403/1
Matthias Sohn [Wed, 14 Feb 2018 22:28:17 +0000 (23:28 +0100)]
Merge branch 'stable-4.10'

* stable-4.10:
  Fix ssh host name handling for Jsch
  Jsch overrides the port in the URI with the one in ~/.ssh/config

Change-Id: I860fc61ceb12ae792b1ee7421046ecd32373b9f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 96/117396/1
Matthias Sohn [Wed, 14 Feb 2018 20:24:54 +0000 (21:24 +0100)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix ssh host name handling for Jsch
  Jsch overrides the port in the URI with the one in ~/.ssh/config

Change-Id: Iff9076f65e767bbe8df016337b631bdaeb40ad98
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>