Commit Graph

6887 Commits

Author SHA1 Message Date
Matthias Sohn 152e4b43a3 pgm: Fix missing braces in Fetch.run()
Change-Id: I4655417fd879733a357bf712a486ce0883021198
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 22:18:41 +01:00
Matthias Sohn 7a64771b9e pgm: Handle IOException in Fetch command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: If8be68621c7135435cd067ef638460b175786b1b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 22:18:41 +01:00
Matthias Sohn e65497ad09 pgm: Handle GitAPIException in Gc command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I4d3c04b27727762870d3135228768aae177ea3fc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 22:18:41 +01:00
Matthias Sohn 8264135d7c pgm: Fix missing braces in DiffTree.run()
Change-Id: Ic75c7e77516ff1c26803e010bf2bdbaf3e9d6ce1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 22:18:40 +01:00
Matthias Sohn c2fb5873b4 pgm: Handle exceptions in DiffTree command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I087b3e510682c68cae74c069b10050c7acb48a29
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 22:18:40 +01:00
Matthias Sohn e2d1736e69 pgm: Fix missing braces in Diff.run()
Change-Id: I326b85f49d9b2f3c753f8a38e3f65ee61ba35db3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 22:18:40 +01:00
Matthias Sohn a6212392d5 pgm: Handle exceptions in Diff command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Iba0e4338381519dc55c2892d95181ddfb881adf2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 22:18:40 +01:00
David Pursehouse b7810bf5a8 RawParseUtils: Avoid import of java.nio.charset.StandardCharsets
The import is only needed because of a reference to it in the Javadoc,
and can be avoided by explicitly specifying the package instead, which
is how it's referenced in other cases (Constants, FileHeader).

Change-Id: I0c6254a9adf1f52fb8f2c04a858b11696ad264f5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 20:27:12 +09:00
David Pursehouse 04c485b396 Consistently import constants from StandardCharsets as static
Change-Id: I143c242c0e3299323ae166a59947b1195539e6bf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 20:25:14 +09:00
David Pursehouse 52923e9b07 LocalDiskRepositoryTestCase#createRepository: Default auto-close to false
Since 8ed59c5 ("Make TestRepository AutoCloseable", Jan 11, 2019) the
TestRepository class is auto-closeable, but instantiations of it were
not converted to use try-with-resource.

Converting to try-with-resource results, in several cases, in the
repository being closed twice because LocalDiskRepositoryTestCase has
logic to close created repositories in the tearDown method. This results
in several tests emitting a warning to the console:

  close() called when useCnt is already zero

Change the default behavior of the createRepository method to not use
the auto-close logic in LocalDiskRepositoryTestCase, so that thy will
instead be closed (only once) using the AutoCloseable implementation.

Deprecate the method that has the autoClose parameter.

Change-Id: I63d62c9913f9b61271667861dae144e551d358c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 20:09:16 +09:00
David Pursehouse 91b1fe4687 UploadPack: Suppress false-positive resource leak warning
Change-Id: Ida09cabb11740e6752a6f079d0528d38021fa2dd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:41:59 +09:00
David Pursehouse 9b2779925c PushConnectionTest: Open TestRepository in try-with-resource
Change-Id: I539b3acea8da914fc745e54b0bf104cf344c181c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:34:21 +09:00
David Pursehouse d7f4e6d1a1 MergerTest: Open TestRepository in try-with-resource
Change-Id: I1c4bd2fd5f0ad7112bd3ebe1506de3cf51231b36
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:33:04 +09:00
David Pursehouse babdae6412 MergeCommandTest: Open TestRepository in try-with-resource
Change-Id: If620f6a98c5e8436a3edb4ee365ec02f41d0ea6a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:29:33 +09:00
David Pursehouse 5d9c78e471 PackWriterTest: Open TestRepository in try-with-resource
Change-Id: Ia4202c860b851bef5db72ea6781b3e6a32484e08
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:28:10 +09:00
David Pursehouse 6efe3612a7 ReceivePackAdvertiseRefsHookTest: Open TestRepository in try-with-resource
Change-Id: I7ab1de3516ac542821275add908ee70c427d781b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:28:10 +09:00
David Pursehouse a2455e9e40 SubmoduleStatusTest: Open TestRepository in try-with-resource
Change-Id: Iebb6abd35fa5b084a4c044e416a448785a3c9291
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:13:43 +09:00
David Pursehouse 43719e73c7 UploadPackTest: Open TestRepository in try-with-resource
Change-Id: Id37a07b00584aa8a884fa11cd6f42a16b44e77f3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:11:30 +09:00
David Pursehouse b6fe0abc4c PackParserTest: Open TestRepository in try-with-resource
Change-Id: Ie3521f40ac80bc58df95f9f5dc79d51b29380461
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:08:01 +09:00
David Pursehouse 5ac044abc0 SmartClientSmartServerTest: Open TestRepository in try-with-resource
Change-Id: If1351920398f574b5b93be55868c157c3cd15290
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 17:02:34 +09:00
David Pursehouse 1a2db96c79 Stop using deprecated methods of RemoteSetUrlCommand/RemoteRemoveCommand
Change-Id: I5234474b359a32bdae501b181f0726be2af1ec6a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 15:12:45 +09:00
David Pursehouse 283830a643 SmartClientSmartServerTest: Stop using deprecated Repository#hasObject
Change-Id: I75d1105934aeaac89476603e15cf642a65a3acbe
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 15:04:53 +09:00
David Pursehouse fb7b94313a DumbClientSmartServerTest: Open TestRepository in try-with-resource
Change-Id: Ica172a85ec9b7da1416ff1b22699809f2c8c9df7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 15:00:08 +09:00
David Pursehouse 4635f38c09 DumbClientDumbServerTest: Open TestRepository in try-with-resource
Change-Id: Iaf339ae739689d4528a079776d6e945ba9006368
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 14:58:35 +09:00
David Pursehouse 7844b39966 DirCacheCheckoutTest: Open TestRepository in try-with-resource
Change-Id: Iaf18ce230d6bf9b8bcb1895dd1bd3e4eb267de10
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 14:55:47 +09:00
David Pursehouse b465657238 HttpTestCase#fsck: Open TestRepository in try-with-resource
Change-Id: Ibda8c9970322871abf0fcf1244977bed04eaedd2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 14:52:09 +09:00
David Pursehouse 6df350ee0e CheckoutCommandTest: Add comment to document intentionally empty catch block
Change-Id: I5156c3c2de67be015ef1d785fcf6084919765635
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-20 14:39:52 +09:00
Matthias Sohn 55a5fdb3a1 pgm: Fix missing braces in Describe.run()
Change-Id: I09e777fd4e77869952d2614ac2cde508b96d61e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:46:21 +01:00
Matthias Sohn 11a9075536 pgm: Handle exceptions in Describe command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Ic5d9d94c4a451f300fb7ad3f71b3e22db9a2c181
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:45:38 +01:00
Matthias Sohn d789c9adab pgm: Handle exceptions in Config command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed. Also
externalize error message.

Change-Id: I909dc77385a672d8298053b12683c0cbbf9f2aa2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:43:19 +01:00
Matthias Sohn 518f420fe6 pgm: Fix too wide lines in Commit.run()
Change-Id: I695d1771b808217b0fbde29805e53a819d8c3303
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:40:05 +01:00
Matthias Sohn 637f95b935 pgm: Fix missing braces in Commit.run()
Change-Id: Ia9e7e846ba1abfdb490896e5bcb82e2c0039439c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:40:01 +01:00
Matthias Sohn 3b059f6ff6 pgm: Handle exceptions in Commit command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Idf5325bcc235fbcf4418239a1d49572409576a7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:27:57 +01:00
Matthias Sohn 5482980e4f pgm: Handle exceptions in Clean command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Ic06bf16c9bfc79753a9ec767f8030a12887df168
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:24:19 +01:00
Matthias Sohn fe52e2fb8e pgm: Handle GitAPIException in Fetch command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I043838143df7280351186ee1bcca4d1cc4832257
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:23:27 +01:00
Matthias Sohn be2ae1e103 Fix missing braces in Branch.run()
Change-Id: Ie8a757552846d2454017a95e20dc14fdf6a93982
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:19:45 +01:00
Matthias Sohn 4d4fe5230e pgm: Handle exceptions in Branch command
This avoids we show a stacktrace on the console by default when one of
the expected exceptions is thrown during the run method is executed.

Change-Id: Ib07cc8dd26b45b62de1d77739380eb36833082f1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:17:10 +01:00
Matthias Sohn c41bb9d3d9 Fix missing braces in Blame.run()
Change-Id: I32a0e973bc73e85a67e975b728b425c148059b81
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:09:40 +01:00
Matthias Sohn 2f94a26b17 pgm: Handle NoWorkTreeException and IOException in Blame command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I9290b057b004e9ee4137d968ba4f5759442aacb6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-20 01:08:26 +01:00
Matthias Sohn 562976f417 Use try-with-resource for reader in Blame.run()
Change-Id: I115aa9854fefeccc2348686e6377b30413911c17
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-17 23:30:29 +01:00
Matthias Sohn 23affa6c77 Prepare 5.3.0-SNAPSHOT builds
Change-Id: I9f0bf3ff2b26f4a8300c98206beb19c2b9d4946a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-17 04:23:42 +01:00
Matthias Sohn 05159ed656 JGit v5.3.0.201901162155-m1
Change-Id: I350925ff3b1fba2c83a448bc4e6d67368573693e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-17 04:17:18 +01:00
Matthias Sohn 13f9aae49a Fix tools/version.sh
The script missed to update all but the first version in
org.eclipse.jgit.coverage/pom.xml

Change-Id: If8021accf07d7b57b477992cc0f1ba8ddc7db9a6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-17 03:10:09 +01:00
Matthias Sohn 8fc2aef89e JGit v5.3.0.201901161700-m1
Change-Id: I935cae5ae09ee5598ebdf6d9209048afec0d42dc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-17 02:39:39 +01:00
Matthias Sohn cced939504 pgm: Handle GitAPIException in Add command
This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I02940bdc1645c1d5e0abeeb4f1bafde1b8c54a1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-17 00:43:39 +01:00
Medha Bhargav Prabhala 137e91a465 Implement signing commits using BouncyCastle
This also includes a change to generating the jgit CLI jar. Shading is
no longer possible because it breaks the signature of BouncyCastle.
Instead, the Spring Boot Loader Maven plug-in is now used to generate an
executable jar.

Bug: 382212
Change-Id: I35ee3d4b06d9d479475ab2e51b29bed49661bbdc
Also-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
Signed-off-by: Medha Bhargav Prabhala <mprabhala@salesforce.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-16 10:05:10 +01:00
Medha Bhargav Prabhala 9150f5d836 Add signing options to commit CLI
Bug: 382212
Change-Id: I02194fc566dd5baa963424b1bac78607964436a3
Also-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
Signed-off-by: Medha Bhargav Prabhala <mprabhala@salesforce.com>
Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
2019-01-16 10:05:10 +01:00
Gunnar Wagenknecht 2343c688b1 Allow CommitCommand to sign commits
This change introduces the concept of a GpgSigner which will sign
commits. The GpgSigner will be of a specific implementation (eg.,
Bouncycastle or OpenPgP executable). The actual implementation is not
part of this change.

Bug: 382212
Change-Id: Iea5da1e885c039e06bc8d679d46b124cbe504c8e
Also-by: Medha Bhargav Prabhala <mprabhala@salesforce.com>
Signed-off-by: Medha Bhargav Prabhala <mprabhala@salesforce.com>
Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
2019-01-16 10:05:09 +01:00
Matthias Sohn 159968abc4 pgm: propagate generic exceptions when throwing Die exception
If a command is stopped by throwing a Die exception since a generic
exception was caught this exception contains additional information
which is not available in the error message. Hence chain it to the Die
exception in order to allow printing a complete stacktrace including
causes to the error stream of the JGit command line by adding option
--show-stack-trace, e.g.

$ jgit --show-stack-trace commit -m "test"

Change-Id: I7ad8c56b997ab60d2bd08f4e7b4d0b80c84021c3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-16 02:22:32 +01:00
Matthias Sohn d4d9625d4b Update Eclipse Java compiler
Update
- orb.eclipse.jdt:ecj to 3.16.0
- plexus-compiler-eclipse to 2.8.5

Change-Id: I56d6d57c4c49646a9c98d2d1ca01b1b1d92280cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-15 09:59:13 +01:00