Commit Graph

6887 Commits

Author SHA1 Message Date
Thomas Wolf 2cb842ef02 SshdSessionFactory: generalize providing default keys
Provide a mechanism for a subclass to provide its own set
of default identities from anywhere as an Iterable<KeyPair>.

The default implementation is functionally unchanged and uses
the known default identity files in the ~/.ssh directory. A subclass
can override the getDefaultKeys() function and return whatever keys
are appropriate.

Bug: 543152
Change-Id: I500d63146bc67e20e051f617790eb87c7cb500b6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-01-22 06:42:26 -05:00
Gunnar Wagenknecht c4420d2434 Allow to check for signing key
The new API is intended for UIs to check if signing will be possible or
would fail

Bug: 543579
Change-Id: I6ce1fd4210e46d49dcdf420c99d08c93e022136c
Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
2019-01-22 03:38:36 -05:00
Thomas Wolf 55966dc592 Handle premature EOF in BundleFetchConnection
BundleFetchConnection.readLine() must abort on EOF, otherwise
it gets stuck in an endless loop.

Bug: 543390
Change-Id: I4cb3428560277888af114b928950d620bb6564f9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2019-01-22 01:49:03 -05:00
Matthias Sohn 39b8f43dcd pgm: Fix missing braces in Version.run()
Change-Id: I4c5633846320f0324714f635b2be388b17cf79fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:55:08 +01:00
Matthias Sohn 7383d34737 pgm: Handle IOException in Version 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: I37e6e3aaba411858042afac02098ce9eaa06f258
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:54:28 +01:00
Matthias Sohn e74592605e pgm: Fix missing braces in UploadPack.run()
Change-Id: I923af9b4ce62d5098828f4322a2a508bf3927bbd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:52:57 +01:00
Matthias Sohn 9bf8a1bf14 pgm: Handle IOException in UploadPack 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: Ife1d8e88387a32de63b0ef31f45499babdbdde3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:52:27 +01:00
Matthias Sohn 7d073c129c pgm: Handle exceptions in Tag 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: I16b528fad74d0c5346d054b3c29070331d60db7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:48:47 +01:00
Matthias Sohn 88d60bf51a pgm: Fix missing braces in Status.run()
Change-Id: Ie30df8ed3d9a1e676f130214a173b622eaf67c6f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:47:13 +01:00
Matthias Sohn c6bd13922f pgm: Handle exceptions in Status 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: I662a343fbb46c35090bd6f840e5a35a88036a65a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:46:37 +01:00
Matthias Sohn b33124c0ee pgm: Fix missing braces in ShowRef.run()
Change-Id: I92bc2008c72bd4495dc3df47a9dd7eb242aab30f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:44:55 +01:00
Matthias Sohn 5ca4075c45 pgm: Handle IOException in ShowRef 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: If18a5d8013f1cb393af3a5e5a1ec9613ac2151bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:44:20 +01:00
Matthias Sohn 390fe5b878 pgm: Fix missing braces in Show.run()
Change-Id: I50097649f1355856e342035d54c55e65270ef507
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:42:41 +01:00
Matthias Sohn e5511f2fbb pgm: Handle exceptions in Show 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: I1c6cc5ecdc44b81e5f3f9b7dc64c3653de5475ba
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:41:37 +01:00
Matthias Sohn 9ef393c747 pgm: Fix missing braces in Rm command
Change-Id: I5ad2f02516917bbd02aa0eb4fb6b05d4b06dc670
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:39:32 +01:00
Matthias Sohn ed0d6e69f9 pgm: Handle GitAPIException in Rm 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: I55c15a35369e790a3ca946d6db0097a57ac6fae5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:39:04 +01:00
Matthias Sohn 795c265c11 pgm: Handle exceptions in RevParse 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: Iae510d8c6af9acd587822a28ad48eab0b2a96ccd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:36:32 +01:00
Matthias Sohn 23af4452e8 pgm: Externalize error message
Change-Id: Id9e33104c9681dc9a57674c1648c994a503fa6b8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:30:51 +01:00
Matthias Sohn 7cee790173 pgm: Fix missing braces in Reset.run()
Change-Id: I1e854ab81063601eb4ff159aabc559cb65ce6ece
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:26:27 +01:00
Matthias Sohn 5c05b9f38c pgm: Handle GitAPIException in Reset 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: I70dce366081cd1fc4539cf195d6310fef1080eb3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:23:36 +01:00
Matthias Sohn c03700dcb0 pgm: Handle GitAPIException in Repo 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: I1a636478bfae8cc0635a3e57be252126e69c19cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:21:26 +01:00
Matthias Sohn ec7ec69819 pgm: Handle exceptions in Remote 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: Ie1985c2570213217c2ea0f376ff99d19bfed4e0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:19:55 +01:00
Matthias Sohn d8fec824e4 pgm: Handle exceptions in Reflog 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: Id25eb523c12c07cbd14e31edfb8b5d7ec9b3ccf3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:19:54 +01:00
Matthias Sohn 8615c042ff pgm: Handle IOException in ReceivePack 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: I9cecd236a8df8a2c2972d5da6031a121f25b1daa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 23:14:24 +01:00
David Pursehouse 3b94cd008f SmartClientSmartServerTest: Open Repository in try-with-resource
Since 52923e9 ("LocalDiskRepositoryTestCase#createRepository: Default
auto-close to false", Jan 20, 2019) the createBareRepository method
creates repositories that do not get automatically closed in #tearDown.

Convert invocations of createBareRepository to use try-with-resource.

Change-Id: I320030c5d4438713971bee33316bff408bac47fc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 15:54:30 +09:00
David Pursehouse ec72e8029e SmartClientSmartServerTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I7005f5821394a3e237cf877cf38557b6a62cacb3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 15:20:25 +09:00
David Pursehouse 4cba10bee4 SmartClientSmartServerTest#addBrokenContext: Remove unused TestRepository
Change-Id: Id2b44199cda7eee7ec949d31b9029ef9325a54f4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 15:17:09 +09:00
David Pursehouse a0f69ff387 IO: Open TemporaryBuffer.Heap in try-with-resource
Change-Id: I78a947fd1263b47b3df17bcc6e9b32497e68dd4a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 14:19:29 +09:00
David Pursehouse f5614e03f1 GitSmartHttpTools: Open SideBandOutputStream in try-with-resource
Change-Id: Ie7c17f98579e7241f2b5c8204435c76686eeb568
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 14:02:02 +09:00
David Pursehouse 95d74f22fb TemporaryBufferTest: Open TemporaryBuffer in try-with-resource
Except the cases where the warning was suppressed in bf757cd because
they are explicitly testing functionality that is not possible in t-w-r.

Change-Id: I6c66eb31a2314028e09a9213dc695cd163f907e9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 13:59:21 +09:00
David Pursehouse d11a40a14c Scanner: Open RevWalk in try-with-resource
Change-Id: Ieeec292c1346edbda2b26f021e75cbc1435bb9f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 13:45:58 +09:00
David Pursehouse 6503a67e46 SubmoduleWalkTest: Open Repository in try-with-resource
Change-Id: I9c4ee4e4c55f48db1f21e18b212657e4dd3de053
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 13:40:48 +09:00
David Pursehouse df774825f5 SideBandOutputStreamTest: Open SideBandOutputStream in try-with-resource
Change-Id: I34041a556a5a83afcd0c1bab00e5d8088c30ea3f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 13:36:31 +09:00
David Pursehouse ecd16a7906 UnionInputStreamTest: Open UnionInputStream in try-with-resource
The tests were written for Java 7 which did not have AutoCloseable
and the try-with-resource concept. When the project was updated to
build with Java 8, the warnings were suppressed.

Remove the suppressions and convert to use try-with-resource.

Change-Id: Ic805bd571c4a2e4376ce5e7c34ca7ac86cbf5104
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 13:28:22 +09:00
David Pursehouse c648a38a47 Merge: Avoid non-localised literal string warning for "recursive"
Instead of using the literal string, take the name from the RECURSIVE
enum value.

Change-Id: I9d8f289232dfc8f784287029c41714ddbdee232b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-01-21 11:03:46 +09:00
Matthias Sohn 9fee751263 pgm: Fix missing braces in Push.run()
Change-Id: I7cc1b3ca022ba131c196d72c1b776de942442b7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:16 +01:00
Matthias Sohn fa3db15049 pgm: Handle exceptions in Push 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: I7a5dc6b1ebaad6f7b8baa35ce68760b79bab8acd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:16 +01:00
Matthias Sohn c821054316 pgm: Fix missing braces in MergeBase.run()
Change-Id: I625053ceb5a81bc0014f7cab0f9fb5e5deaacc36
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:15 +01:00
Matthias Sohn 6c847b30c0 pgm: Handle IOException in MergeBase 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: I5f198f71adfbb43ec1af26285658a5d5bdfa1904
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:15 +01:00
Matthias Sohn d614ba3334 pgm: Fix missing braces in Merge command
Change-Id: I39495d832ff4e48a97182faef88871902d3edb11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:15 +01:00
Matthias Sohn 67910b0570 pgm: Handle exceptions in Merge 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: I7afd038d8def9d2f409c0ed297b9db8ea2fc75c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:15 +01:00
Matthias Sohn 0eb0d6c58f pgm: Fix missing braces in LsTree.run()
Change-Id: Iac1755c2ec8094cd211bbc9f1d819cc8052e20cb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:15 +01:00
Matthias Sohn a19ad89d99 pgm: Handle exceptions in LsTree 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: Ib3ae59eeb90143eca1a0b515c59457a0eb2cc383
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:14 +01:00
Matthias Sohn 1b16fed56a pgm: Fix missing braces in LsRemote.run()
Change-Id: I779a6c28f7e8c4ba0527eb872454fd2cc3d81304
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:14 +01:00
Matthias Sohn 40562d7f5c pgm: Handle exceptions in LsRemote 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: If7dd168f3e8d2b729f1eab48d4e95fe837bb7a33
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:14 +01:00
Matthias Sohn 1978f180a2 pgm: Handle exceptions in LsFiles 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: I7d71e194f0a7e4180094a9b36dbb55dd90c9722e
2019-01-21 00:54:14 +01:00
Matthias Sohn 5739d1b314 pgm: Fix missing braces in Log.run()
Change-Id: I3e4f41150aeeffc8c609ef14ce5b6d428c4595d7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:13 +01:00
Matthias Sohn 64386cbfb7 pgm: Handle exceptions in Log 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: Ibca80cf2195db01298f2b95f507cfa3de2f403e7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:13 +01:00
Matthias Sohn 2d7806da31 pgm: Handle exceptions in Init 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: Ib8b26a6a02903de63ef58687a4a0820649d59f99
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:13 +01:00
Matthias Sohn 8b15ff57c8 pgm: Handle IOException in IndexPack 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: Ie8a8388daecb0500f04197462210606c42f143c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-01-21 00:54:10 +01:00