Commit Graph

4316 Commits

Author SHA1 Message Date
David Pursehouse 615280ba07 RefDirectoryTest: Fix warning about member variable hiding
The parameter name 'totalWork' was hiding a class member variable
of the same name.

Change-Id: I646525e82900e23ffabfc756bcf5052ef873656a
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-12 12:30:46 +09:00
David Pursehouse 952f381981 ReflogResolveTest: Open Git instances in try-with-resource
Change-Id: I11ee38bfcf4951bf05a1632df08b1d074d38338b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-12 12:29:44 +09:00
David Pursehouse 77887b49f9 ReflogTest: Open Git instances in try-with-resource
Change-Id: I950b6f16148cfe11de729b04904f88d6e4c28b9a
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-12 12:26:58 +09:00
David Pursehouse 5ca9aaa172 RepoCommandTest: Open Git instances in try-with-resource
Change-Id: I171e84eeb7862e74761ba6c961f14c86beaba9e7
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-12 12:25:20 +09:00
Matthias Sohn 26012958a3 Merge branch 'stable-4.1' into stable-4.2
* stable-4.1:
  Fix diff for added and removed submodule

Change-Id: I37dd71ed19b06e9bbcffe37370081ab875c6d8d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-10 00:45:18 +01:00
David Pursehouse 4e5255c59a RepoProject: Fix warnings about variable hiding
Method parameter names were hiding class members of the same
name.

Change-Id: I182f2715894ac4259b09a371cb4e0eb24f52518a
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 18:22:58 +09:00
David Pursehouse ef471b0861 RepoTest: Open Git in try-with-resources
Allocate a new Git for each part of the test, rather than
reassigning to the same variable.

Change-Id: Ic83778bbff0b2f57d37b95aef70324859d42cd58
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 18:17:02 +09:00
David Pursehouse 143ba06cd6 RepositoryResolveTest: Open Git in try-with-resource
Change-Id: Ibb612f3d8fd0f9913291430474311d9da62f4e6f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 18:14:26 +09:00
David Pursehouse b85e93046c RepositoryTestCase: Open autocloseable types in try-with-resource
ObjectInserter.Formatter and Git are autocloseable and can be
opened in try-with-resource to prevent a resource leak warning.

Change-Id: I48c4001aaa7d9c1e36369e9799bfbb7c3bb46d8b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 18:12:05 +09:00
David Pursehouse a176c6055a ResetCommandTest: Use Git member in testHardResetAfterSquashMerge
Use the class member instance of the Git rather than creating
a new one in the test. This makes it consistent with the other
tests in the module.

Change-Id: Ibe822ded76a80b94922e92bbc6f5d90bcc52f8a3
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:36:05 +09:00
David Pursehouse 8074f50b58 ResolveMergerTest: Open Git in try-with-resource
Change-Id: Ic378ec25c4a3ea4354ee643029f87e46b6449ed4
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:31:11 +09:00
David Pursehouse 3c4e7c08a7 RevCommitListTest: Open Git and RevWalk in try-with-resource
Change-Id: I4ba273a364a12f82a3b3b06ba050bc633411daf6
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:26:03 +09:00
David Pursehouse 5bfdc3341c RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: Iaa87c51bc19b4fa832393c11db20b69865d30d48
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:20:51 +09:00
David Pursehouse f0ef7748b4 RevObjectTest: Open RevWalk in try-with-resource
Change-Id: I19bcbb2f12036c5043436f3d544ccefbb7385b8d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:17:12 +09:00
David Pursehouse 44f64de091 RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I2341977223be1dc5252492f4775626122f56496b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:15:19 +09:00
David Pursehouse 895510fc48 RevertCommandTest: Open Git in try-with-resource
Change-Id: I659adbb0a6f741c4c6f615c8a24b4603c3f6681e
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:12:57 +09:00
David Pursehouse d882bf8c4d SquashMessageFormatterTest: Open git in try-with-resource
Change-Id: Ife94d1f0279ed3671a9bca79fb26c0403549fa17
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:05:05 +09:00
David Pursehouse 6aa619ec5c StatusCommandTest: Open Git in try-with-resource
Change-Id: Id13ad9fa3157d0479da12fb8184437be3ca8c948
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 17:03:44 +09:00
David Pursehouse 96ff311049 SubmoduleAddTest: Open Git in try-with-resource
Change-Id: I1276ce206e891729adfa681e00952ca0ba6ffc53
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 14:11:54 +09:00
David Pursehouse 3742946a03 SymlinksTest: Open git and TreeWalk in try-with-resource
Change-Id: I0fd1933e843375029fa795447b688f23a893f84b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 14:05:22 +09:00
David Pursehouse d0d3773763 T0003_BasicTest: Open autocloseable types in try-with-resource
FileRepository and ObjectInserter.Formatter are autocloseable, so
use try-with-resource for these.

Remove suppression of unused variable warning that is no longer
necessary.

Change-Id: I270829f0a4030083c9599eb5785b0145dc590ed8
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 11:51:27 +09:00
David Pursehouse 84ae3f4991 TextHashFunctions: Fix warnings about variable hiding
The local variables/arguments named 'db' were hiding the member
variable of the same name in the superclass TextBuiltin.

Change-Id: Ic49dcb7cc2a1b3fb46ad78450042c8c8fb464a80
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 11:46:45 +09:00
David Pursehouse a82f5c7425 TreeFilterTest: Open TreeWalk in try-with-resource
Change-Id: If100a66e544926bcffe9a9a0b31bfd4806902864
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 11:44:12 +09:00
David Pursehouse 62637584d8 TreeWalkJava7Test: Open TreeWalk in try-with-resource
Change-Id: I99a483c482b5395653b0d57b368ec1b5fdba450c
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-05 11:42:44 +09:00
Hugo Arès df904a4227 Fix diff for added and removed submodule
Since If13f7b406, submodule difference are shown as a hunk. The issue
was that added and removed submodule were considered as Edit.REPLACE
instead of Edit.INSERT and Edit.DELETE in the DiffFormatter result.

Change-Id: I4330c2aa3f10e29d7d6b0b2e5286e59293a06239
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
2016-02-04 10:27:50 -05:00
David Pursehouse 06bf69d8ca DirCacheCheckoutTest: Open Git and TreeWalk in try-with-resource
Change-Id: Icc8eda841e6a437e1acf3438525014e7c46d5eb2
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:30:30 +09:00
David Pursehouse 521f513d6d CommitCommand: Remove declaration of unthrown exception
Change-Id: I1795b1e510ab170f062ee6c5988d7a7567abe260
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:27:47 +09:00
David Pursehouse 2fab7f20a7 Branch: Fix variable hiding warning
The Branch class has a member named 'branch', which was being
hidden by the local variable of the same name used in a for-loop.

Change-Id: I334092010a9c80686fb79713852d4bfa166ce12f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:25:55 +09:00
David Pursehouse d4ddb6fc2b ApplyCommandTest: Open Git in try-with-resource
Also, add missing braces around if-block.

Change-Id: I9390b2c7d5c4507923b6f06271a070dc868534e5
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:22:32 +09:00
David Pursehouse 5c84145fd0 PackFileTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I9c56b5efdb9c13b929073a786092a707fca21281
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:20:38 +09:00
David Pursehouse bebd30f364 FileTreeIteratorTest: Open Git and RevWalk in try-with-resource
Change-Id: I6e68c4b028e0aa01964eace10307372060371df7
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-26 17:56:47 +09:00
David Pursehouse 92a8e0184c RebaseCommandTest: Open RevWalk in try-with-resource
Change-Id: If7b7a90171d1349d634a84f135471ebac29e3210
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 17:05:14 +09:00
David Pursehouse 7ccda5f63e PullCommandTest: Open RevWalk in try-with-resource
Change-Id: I676cd7ef4bb29f980a313acd77506dd070e6c98f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 15:23:06 +09:00
David Pursehouse e5cf4a89fd BlameGeneratorTest: Create Git instances in try-with-resource
Change-Id: I2dc4191603fbd6c3214763b869882c51b0e53284
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 15:20:24 +09:00
David Pursehouse 88d63ce174 Remove unnecessary suppression of deprecation warnings in tests
Change-Id: I722f8c2e80129e0129349b55a53b29626e2af21c
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 12:00:57 +09:00
David Pursehouse 4c128b0764 DiffEntryTest: Open Git and TreeWalk in try-with-resource
Change-Id: If4a49268b9b7ec3a44ed1508ed78db365b0c9e5b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 11:55:46 +09:00
David Pursehouse 6b66240311 DiffCommandTest: Open Git and RevWalk in try-with-resource
Change-Id: I966f7e5053651661abc7de63c968e1f5bf2de464
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 11:48:58 +09:00
David Pursehouse ff90192a05 CommitCommandTest: Open Git and TreeWalk in try-with-resource
Change-Id: I65a6fd7028e209c300d992c2756100c09ab4dc19
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 10:41:24 +09:00
Matthias Sohn 281dcf8956 Merge changes Ifdb33501,Idc7b7bbd,Ia3db8696,I4ef82311,I3ad58d4c, ... into stable-4.2
* changes:
  ConcurrentRepackTest: Don't use deprecated WindowCache.reconfigure
  ConcurrentRepackTest: Open RevWalk in try-with-resource
  CommitOnlyTest: Open RevWalk in try-with-resource
  UnpackedObjectTest: Create ObjectInserter.Formatter in try-with-resource
  FileRepositoryBuilderTest: Use try-with-resource for auto-closeables
  RepositorySetupWorkDirTest: Fix "resource leak" warnings
2016-01-23 20:11:04 -05:00
David Pursehouse 4319086892 ConcurrentRepackTest: Don't use deprecated WindowCache.reconfigure
Replace with calls to WindowCacheConfig.install() as mentioned in
WindowCache.reconfigure's deprecation notice.

Change-Id: Ifdb33501a2209239029c815b1e4e844ea5b56075
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 15:03:33 +09:00
David Pursehouse 8bbd9077e4 ConcurrentRepackTest: Open RevWalk in try-with-resource
Change-Id: Idc7b7bbdc1df05372b873cbe4c495474f3ffd64b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 14:59:54 +09:00
David Pursehouse 625a21f5f4 CommitOnlyTest: Open RevWalk in try-with-resource
Change-Id: Ia3db8696f66f8d294e1d443fb54e716d26d517b1
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 14:57:21 +09:00
David Pursehouse 84ac3cc379 UnpackedObjectTest: Create ObjectInserter.Formatter in try-with-resource
The ObjectInserter.Formatter instance is only used to call idFor.

Factor out a utility method to do that.

Change-Id: I4ef823110c2152ac7905681df3217eb8001f5bd9
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 14:51:59 +09:00
David Pursehouse 3ee9e2ac07 FileRepositoryBuilderTest: Use try-with-resource for auto-closeables
Use try-with-resource to create instances of FileRepository and
FileWriter.

"resource" and "unused" warnings no longer occur, so remove the
suppression annotations.

Change-Id: I3ad58d4cc2d4c019cd8edda7cb401e9d9f3fb790
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 14:31:50 +09:00
David Pursehouse ddcbd22cd3 RepositorySetupWorkDirTest: Fix "resource leak" warnings
Use FileRepositoryBuilder to create the Repository, except in cases
where the creation was already in a try-block. Convert those to use
a try-with-resource.

Change-Id: I7d7adeee81bda6e80d91a119c7d690de3d00dc2b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 14:21:15 +09:00
Matthias Sohn 5da5eb4b69 Remove java7 bundle from Maven central scripts
The bundle org.eclipse.jgit.java7 was deleted in 4.0

Change-Id: I57dbc0b18eaf164c8f53cc2b776ecb80481a993d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-22 01:50:36 +01:00
Matthias Sohn fc4d117511 Prepare 4.2.1-SNAPSHOT builds
Change-Id: Ic9eac53b10ac97b2038b334d388ae3d21393f993
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-22 01:48:52 +01:00
Matthias Sohn 20c2079f70 JGit v4.2.0.201601211800-r
Change-Id: I89f33b0da81ff499315baa5311f95f31724fa510
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21 23:47:12 +01:00
Laurent Delaigue 4409751516 Add progress monitor to Merger
Monitoring progress of merges can be useful for users for large
repositories or complex merge processes that take some time.

This enables setting a monitor. Existing merge implementations in jgit
do not yet report progress if a monitor is set. This will be added in a
later change.

Change-Id: I17b978b3fc91750dd88649638b90a46820a0877c
Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21 17:08:04 +01:00
Chris Gavin 82f47ace3d Fix TransportException when reading bundle
When reading a bundle file, commit messages who's oneline format is
longer than 982 characters caused JGit to treat subsequent text in
the commit as a SHA, then throw a TransportException because it's
not a valid SHA.

Now the readLine method will read all the way to the end of the
line, not just the first 1024 characters of it.

Change-Id: If15b491aa9a1e4fd9b8bbed2dd9e6be47a64ccb7
Signed-off-by: Chris Gavin <chris@chrisgavin.me>
2016-01-21 17:07:57 +01:00