]> source.dussan.org Git - jgit.git/log
jgit.git
5 years agoFix NPE in PlotCommitList 96/137096/1
Matthias Sohn [Mon, 18 Feb 2019 00:25:12 +0000 (01:25 +0100)]
Fix NPE in PlotCommitList

Bug: 544513
Change-Id: I2fca766bbdc441a2dca947fba5dde532de7a10fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCommitBuilder: Deprecate setEncoding(String) 77/136977/2
David Pursehouse [Fri, 15 Feb 2019 07:46:37 +0000 (16:46 +0900)]
CommitBuilder: Deprecate setEncoding(String)

Deprecate the method in favor of setEncoding(Charset).

Update the only caller in the code base that was still using
the deprecated variant.

Change-Id: I6357f2d0c727007013c72e9d5b7c72a3f5f3f2b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoCommitBuilder: Add missing periods on methods' Javadoc 76/136976/2
David Pursehouse [Fri, 15 Feb 2019 07:49:28 +0000 (16:49 +0900)]
CommitBuilder: Add missing periods on methods' Javadoc

Change-Id: Ibcf64b23de8534f7831d6e40ee4b0ad2bade74ce
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUpgrade wagon-ssh to 3.3.2 66/136666/2
David Pursehouse [Mon, 11 Feb 2019 10:10:14 +0000 (19:10 +0900)]
Upgrade wagon-ssh to 3.3.2

Change-Id: I203572eb47187d476622eb416f6ac8d791b747c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFix bug in copyPackBypassCache's skip 'PACK' header logic 72/136872/5
Minh Thai [Wed, 13 Feb 2019 20:16:42 +0000 (12:16 -0800)]
Fix bug in copyPackBypassCache's skip 'PACK' header logic

Bug caused the pack to be 12 bytes short when cold cache.  Also added
test for copyPackAsIs method.

Change-Id: Idf8fb0e50d1215245d4b032e2e00df4b218c115f
Signed-off-by: Minh Thai <mthai@google.com>
5 years agoUpgrade spotbugs to 3.1.11 25/136225/1
David Pursehouse [Mon, 4 Feb 2019 11:15:13 +0000 (20:15 +0900)]
Upgrade spotbugs to 3.1.11

Change-Id: I24bb63fc5e1241420f6fc72e8c4708d5201c4f2b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoAtomic file creation: hard-linking may not be allowed 73/135973/2
Thomas Wolf [Tue, 29 Jan 2019 21:20:07 +0000 (22:20 +0100)]
Atomic file creation: hard-linking may not be allowed

Android for instance forbids hard linking via a SELinux
policy. If we can't hard link, the NFS work-around for
atomic file creation cannot work at all. In this case,
fall back to not using the hard-linking mechanism.

Android throws an AccessDeniedException, so we catch that.
The javadoc on Files.createLink() indicates that another
possibility might be a SecurityException, so catch that,
too.

Bug: 543956
Change-Id: I551b7a45f7b2fbbd8cf94f0b7233dbd8a200520e
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoUpdate Orbit to S20190129210011 96/135996/1
Matthias Sohn [Wed, 30 Jan 2019 09:52:38 +0000 (10:52 +0100)]
Update Orbit to S20190129210011

This is the Orbit stable build for 2019-03 M2

Change-Id: I6db8e030af6bcec9c50065cb66211280d366dfa8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix GC.deleteEmptyRefsFolders 09/135809/3
Matthias Sohn [Sun, 27 Jan 2019 01:22:34 +0000 (02:22 +0100)]
Fix GC.deleteEmptyRefsFolders

This method tried to iterate spurious files which may exist in the
.git/refs folder, e.g. on Mac a .DS_Store may have been created there by
inspecting the folder using the finder application. This led to a
NotDirectoryException when deleteEmptyRefsFolders tried to create an
iterator for such a file entry. Skip files contained in the refs folder
to ensure the method only tries to iterate contained folders but not
files.

Change-Id: I5f31e733072a35db1e93908a9c69a8891ae5c206
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoEnable cloning only specific tags 14/133814/4
Thomas Wolf [Mon, 10 Dec 2018 23:47:13 +0000 (00:47 +0100)]
Enable cloning only specific tags

Single-branch-clone should be able to clone a single tag. Enhance
CloneCommand to accept also full refs of tags in setBranchesToClone().
Make sure we also include fetch ref specs for the fetch command for
tags. This mimics the behavior of native git's single-branch clone:
git clone --branch <tag> --single-branch <URI>

Bug: 542611
Change-Id: I285cf043751d9b0ba71258ee8214c0e5d1191428
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoDelete jgit-4.5 target platform 99/135799/2
Matthias Sohn [Fri, 25 Jan 2019 23:36:12 +0000 (00:36 +0100)]
Delete jgit-4.5 target platform

Change-Id: If38b605b98cad55ee83cb7c0a6a972489031e447
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoAdd 4.11-staging target platform and update Orbit to I20190123233226 58/135658/3
Matthias Sohn [Fri, 25 Jan 2019 23:34:08 +0000 (00:34 +0100)]
Add 4.11-staging target platform and update Orbit to I20190123233226

Update
- org.apache.httpcomponents.httpcore to 4.4.10.v20190123-2214
- org.apache.httpcomponents.httpclient.source to 4.5.6.v20190123-2215
- org.bouncycastle.bcpg to 1.60.0.v20181210-2057
- org.bouncycastle.pkix to 1.60.0.v20181210-2057
- org.bouncycastle.prov to 1.60.0.v20181210-2057

Change-Id: I132b6686aa29b2a76cc529f7cae34115604c754d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpgrade jacoco-maven-plugin to 0.8.3 10/135810/1
David Pursehouse [Sun, 27 Jan 2019 07:57:15 +0000 (16:57 +0900)]
Upgrade jacoco-maven-plugin to 0.8.3

Change-Id: I1df9ed2d696613297f9e694876d94c28aaf56339
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Format BUILD file with buildifier 02/135602/2
David Pursehouse [Wed, 23 Jan 2019 08:39:48 +0000 (17:39 +0900)]
Bazel: Format BUILD file with buildifier

$ buildifier -lint=fix BUILD

Change-Id: Ie2e069db3936ce6a85c4c29e6a0137cda5e21f09
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoRenameBranchCommand: more consistent handling of short ref names 99/133599/5
Thomas Wolf [Thu, 6 Dec 2018 14:49:25 +0000 (15:49 +0100)]
RenameBranchCommand: more consistent handling of short ref names

Several problems:

* The command didn't specify whether it expected short or full names.
* For the new name, it expected a short name, but then got confused
  if tags or both local and remote branches with the same name existed.
* For the old name, it accepted either a short or a full name, but
  again got confused if a short name was given and a tag with the
  same name existed.

With such an interface, one cannot use Repository.findRef() to
reliably find the branch to rename. Use exactRef() for the new
name as by the time the Ref is needed its full name is known.
For determining the old Ref from the name, do the resolution
explicitly: first try exactRef (assuming the old name is a full
name); if that doesn't find anything, try "refs/heads/<old>" and
"refs/remotes/<old>" explicitly. Throw an exception if the name
is ambiguous, or if exactRef returned something that is not a
branch (refs/tags/... or also refs/notes/...).

Document in the javadoc what kind of names are valid, and add tests.

A user can still shoot himself in the foot if he chooses exceptionally
stupid branch names. For instance, it is still possible to rename a
branch to "refs/heads/foo" (full name "refs/heads/refs/heads/foo"),
but it cannot be renamed further using the new short name if a branch
with the full name "refs/heads/foo" exists. Similar edge cases exist
for other dumb branch names, like a branch with the short name
"refs/tags/foo". Renaming using the full name is always possible.

Bug: 542446
Change-Id: I34ac91c80c0a00c79a384d16ce1e727c550d54e9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoSshdSessionFactory: generalize providing default keys 80/134680/4
Thomas Wolf [Sat, 5 Jan 2019 16:37:25 +0000 (17:37 +0100)]
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>
5 years agoAllow to check for signing key 50/135350/4
Gunnar Wagenknecht [Fri, 18 Jan 2019 17:37:38 +0000 (09:37 -0800)]
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>
5 years agoHandle premature EOF in BundleFetchConnection 00/135300/4
Thomas Wolf [Thu, 17 Jan 2019 22:04:46 +0000 (23:04 +0100)]
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>
5 years agopgm: Fix missing braces in Version.run() 22/135522/1
Matthias Sohn [Mon, 21 Jan 2019 22:55:08 +0000 (23:55 +0100)]
pgm: Fix missing braces in Version.run()

Change-Id: I4c5633846320f0324714f635b2be388b17cf79fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in Version command 21/135521/1
Matthias Sohn [Mon, 21 Jan 2019 22:54:28 +0000 (23:54 +0100)]
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>
5 years agopgm: Fix missing braces in UploadPack.run() 20/135520/1
Matthias Sohn [Mon, 21 Jan 2019 22:52:57 +0000 (23:52 +0100)]
pgm: Fix missing braces in UploadPack.run()

Change-Id: I923af9b4ce62d5098828f4322a2a508bf3927bbd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in UploadPack command 19/135519/1
Matthias Sohn [Mon, 21 Jan 2019 22:52:27 +0000 (23:52 +0100)]
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>
5 years agopgm: Handle exceptions in Tag command 18/135518/1
Matthias Sohn [Mon, 21 Jan 2019 22:48:47 +0000 (23:48 +0100)]
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>
5 years agopgm: Fix missing braces in Status.run() 17/135517/1
Matthias Sohn [Mon, 21 Jan 2019 22:47:13 +0000 (23:47 +0100)]
pgm: Fix missing braces in Status.run()

Change-Id: Ie30df8ed3d9a1e676f130214a173b622eaf67c6f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Status command 16/135516/1
Matthias Sohn [Mon, 21 Jan 2019 22:46:37 +0000 (23:46 +0100)]
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>
5 years agopgm: Fix missing braces in ShowRef.run() 15/135515/1
Matthias Sohn [Mon, 21 Jan 2019 22:44:55 +0000 (23:44 +0100)]
pgm: Fix missing braces in ShowRef.run()

Change-Id: I92bc2008c72bd4495dc3df47a9dd7eb242aab30f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in ShowRef command 14/135514/1
Matthias Sohn [Mon, 21 Jan 2019 22:44:20 +0000 (23:44 +0100)]
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>
5 years agopgm: Fix missing braces in Show.run() 13/135513/1
Matthias Sohn [Mon, 21 Jan 2019 22:42:41 +0000 (23:42 +0100)]
pgm: Fix missing braces in Show.run()

Change-Id: I50097649f1355856e342035d54c55e65270ef507
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Show command 12/135512/1
Matthias Sohn [Mon, 21 Jan 2019 22:41:37 +0000 (23:41 +0100)]
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>
5 years agopgm: Fix missing braces in Rm command 11/135511/1
Matthias Sohn [Mon, 21 Jan 2019 22:39:32 +0000 (23:39 +0100)]
pgm: Fix missing braces in Rm command

Change-Id: I5ad2f02516917bbd02aa0eb4fb6b05d4b06dc670
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle GitAPIException in Rm command 10/135510/1
Matthias Sohn [Mon, 21 Jan 2019 22:39:04 +0000 (23:39 +0100)]
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>
5 years agopgm: Handle exceptions in RevParse command 09/135509/1
Matthias Sohn [Mon, 21 Jan 2019 22:36:32 +0000 (23:36 +0100)]
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>
5 years agopgm: Externalize error message 08/135508/1
Matthias Sohn [Mon, 21 Jan 2019 22:30:51 +0000 (23:30 +0100)]
pgm: Externalize error message

Change-Id: Id9e33104c9681dc9a57674c1648c994a503fa6b8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in Reset.run() 07/135507/1
Matthias Sohn [Mon, 21 Jan 2019 22:26:27 +0000 (23:26 +0100)]
pgm: Fix missing braces in Reset.run()

Change-Id: I1e854ab81063601eb4ff159aabc559cb65ce6ece
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle GitAPIException in Reset command 06/135506/1
Matthias Sohn [Mon, 21 Jan 2019 22:23:36 +0000 (23:23 +0100)]
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>
5 years agopgm: Handle GitAPIException in Repo command 05/135505/1
Matthias Sohn [Mon, 21 Jan 2019 22:21:26 +0000 (23:21 +0100)]
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>
5 years agopgm: Handle exceptions in Remote command 04/135504/1
Matthias Sohn [Mon, 21 Jan 2019 22:19:32 +0000 (23:19 +0100)]
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>
5 years agopgm: Handle exceptions in Reflog command 03/135503/1
Matthias Sohn [Mon, 21 Jan 2019 22:17:00 +0000 (23:17 +0100)]
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>
5 years agopgm: Handle IOException in ReceivePack command 02/135502/1
Matthias Sohn [Mon, 21 Jan 2019 22:14:24 +0000 (23:14 +0100)]
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>
5 years agoSmartClientSmartServerTest: Open Repository in try-with-resource 56/135456/1
David Pursehouse [Mon, 21 Jan 2019 06:35:38 +0000 (15:35 +0900)]
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>
5 years agoSmartClientSmartServerTest: Open ObjectInserter.Formatter in try-with-resource 54/135454/1
David Pursehouse [Mon, 21 Jan 2019 06:20:25 +0000 (15:20 +0900)]
SmartClientSmartServerTest: Open ObjectInserter.Formatter in try-with-resource

Change-Id: I7005f5821394a3e237cf877cf38557b6a62cacb3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSmartClientSmartServerTest#addBrokenContext: Remove unused TestRepository 53/135453/1
David Pursehouse [Mon, 21 Jan 2019 06:17:09 +0000 (15:17 +0900)]
SmartClientSmartServerTest#addBrokenContext: Remove unused TestRepository

Change-Id: Id2b44199cda7eee7ec949d31b9029ef9325a54f4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoIO: Open TemporaryBuffer.Heap in try-with-resource 52/135452/1
David Pursehouse [Mon, 21 Jan 2019 05:19:29 +0000 (14:19 +0900)]
IO: Open TemporaryBuffer.Heap in try-with-resource

Change-Id: I78a947fd1263b47b3df17bcc6e9b32497e68dd4a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoGitSmartHttpTools: Open SideBandOutputStream in try-with-resource 51/135451/1
David Pursehouse [Mon, 21 Jan 2019 05:02:02 +0000 (14:02 +0900)]
GitSmartHttpTools: Open SideBandOutputStream in try-with-resource

Change-Id: Ie7c17f98579e7241f2b5c8204435c76686eeb568
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoTemporaryBufferTest: Open TemporaryBuffer in try-with-resource 50/135450/1
David Pursehouse [Mon, 21 Jan 2019 04:57:46 +0000 (13:57 +0900)]
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>
5 years agoScanner: Open RevWalk in try-with-resource 49/135449/1
David Pursehouse [Mon, 21 Jan 2019 04:45:58 +0000 (13:45 +0900)]
Scanner: Open RevWalk in try-with-resource

Change-Id: Ieeec292c1346edbda2b26f021e75cbc1435bb9f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSubmoduleWalkTest: Open Repository in try-with-resource 48/135448/1
David Pursehouse [Mon, 21 Jan 2019 04:40:48 +0000 (13:40 +0900)]
SubmoduleWalkTest: Open Repository in try-with-resource

Change-Id: I9c4ee4e4c55f48db1f21e18b212657e4dd3de053
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSideBandOutputStreamTest: Open SideBandOutputStream in try-with-resource 47/135447/1
David Pursehouse [Mon, 21 Jan 2019 04:36:31 +0000 (13:36 +0900)]
SideBandOutputStreamTest: Open SideBandOutputStream in try-with-resource

Change-Id: I34041a556a5a83afcd0c1bab00e5d8088c30ea3f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUnionInputStreamTest: Open UnionInputStream in try-with-resource 46/135446/1
David Pursehouse [Mon, 21 Jan 2019 04:28:22 +0000 (13:28 +0900)]
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>
5 years agoMerge: Avoid non-localised literal string warning for "recursive" 45/135445/1
David Pursehouse [Sun, 20 Jan 2019 23:12:19 +0000 (08:12 +0900)]
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>
5 years agopgm: Fix missing braces in Push.run() 41/135441/2
Matthias Sohn [Sun, 20 Jan 2019 20:54:27 +0000 (21:54 +0100)]
pgm: Fix missing braces in Push.run()

Change-Id: I7cc1b3ca022ba131c196d72c1b776de942442b7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Push command 40/135440/2
Matthias Sohn [Sun, 20 Jan 2019 20:53:30 +0000 (21:53 +0100)]
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>
5 years agopgm: Fix missing braces in MergeBase.run() 39/135439/2
Matthias Sohn [Sun, 20 Jan 2019 20:51:09 +0000 (21:51 +0100)]
pgm: Fix missing braces in MergeBase.run()

Change-Id: I625053ceb5a81bc0014f7cab0f9fb5e5deaacc36
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in MergeBase command 38/135438/2
Matthias Sohn [Sun, 20 Jan 2019 20:49:21 +0000 (21:49 +0100)]
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>
5 years agopgm: Fix missing braces in Merge command 37/135437/2
Matthias Sohn [Sun, 20 Jan 2019 20:48:09 +0000 (21:48 +0100)]
pgm: Fix missing braces in Merge command

Change-Id: I39495d832ff4e48a97182faef88871902d3edb11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Merge command 36/135436/2
Matthias Sohn [Sun, 20 Jan 2019 20:46:09 +0000 (21:46 +0100)]
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>
5 years agopgm: Fix missing braces in LsTree.run() 35/135435/2
Matthias Sohn [Sun, 20 Jan 2019 20:37:38 +0000 (21:37 +0100)]
pgm: Fix missing braces in LsTree.run()

Change-Id: Iac1755c2ec8094cd211bbc9f1d819cc8052e20cb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in LsTree command 34/135434/2
Matthias Sohn [Sun, 20 Jan 2019 20:37:04 +0000 (21:37 +0100)]
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>
5 years agopgm: Fix missing braces in LsRemote.run() 33/135433/2
Matthias Sohn [Sun, 20 Jan 2019 20:34:40 +0000 (21:34 +0100)]
pgm: Fix missing braces in LsRemote.run()

Change-Id: I779a6c28f7e8c4ba0527eb872454fd2cc3d81304
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in LsRemote command 32/135432/2
Matthias Sohn [Sun, 20 Jan 2019 20:34:07 +0000 (21:34 +0100)]
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>
5 years agopgm: Handle exceptions in LsFiles command 31/135431/2
Matthias Sohn [Sun, 20 Jan 2019 20:32:21 +0000 (21:32 +0100)]
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

5 years agopgm: Fix missing braces in Log.run() 30/135430/2
Matthias Sohn [Sun, 20 Jan 2019 20:31:07 +0000 (21:31 +0100)]
pgm: Fix missing braces in Log.run()

Change-Id: I3e4f41150aeeffc8c609ef14ce5b6d428c4595d7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Log command 29/135429/2
Matthias Sohn [Sun, 20 Jan 2019 20:29:37 +0000 (21:29 +0100)]
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>
5 years agopgm: Handle exceptions in Init command 44/135444/1
Matthias Sohn [Sun, 20 Jan 2019 23:48:33 +0000 (00:48 +0100)]
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>
5 years agopgm: Handle IOException in IndexPack command 28/135428/2
Matthias Sohn [Sun, 20 Jan 2019 23:47:26 +0000 (00:47 +0100)]
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>
5 years agopgm: Fix missing braces in Fetch.run() 27/135427/1
Matthias Sohn [Sun, 20 Jan 2019 20:21:13 +0000 (21:21 +0100)]
pgm: Fix missing braces in Fetch.run()

Change-Id: I4655417fd879733a357bf712a486ce0883021198
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in Fetch command 26/135426/1
Matthias Sohn [Sun, 20 Jan 2019 20:19:53 +0000 (21:19 +0100)]
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>
5 years agopgm: Handle GitAPIException in Gc command 25/135425/1
Matthias Sohn [Sun, 20 Jan 2019 20:16:21 +0000 (21:16 +0100)]
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>
5 years agopgm: Fix missing braces in DiffTree.run() 24/135424/1
Matthias Sohn [Sun, 20 Jan 2019 20:13:09 +0000 (21:13 +0100)]
pgm: Fix missing braces in DiffTree.run()

Change-Id: Ic75c7e77516ff1c26803e010bf2bdbaf3e9d6ce1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in DiffTree command 23/135423/1
Matthias Sohn [Sun, 20 Jan 2019 20:12:03 +0000 (21:12 +0100)]
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>
5 years agopgm: Fix missing braces in Diff.run() 22/135422/1
Matthias Sohn [Sun, 20 Jan 2019 20:07:28 +0000 (21:07 +0100)]
pgm: Fix missing braces in Diff.run()

Change-Id: I326b85f49d9b2f3c753f8a38e3f65ee61ba35db3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Diff command 21/135421/1
Matthias Sohn [Sun, 20 Jan 2019 20:04:43 +0000 (21:04 +0100)]
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>
5 years agoRawParseUtils: Avoid import of java.nio.charset.StandardCharsets 14/135414/1
David Pursehouse [Sun, 20 Jan 2019 11:25:53 +0000 (20:25 +0900)]
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>
5 years agoConsistently import constants from StandardCharsets as static 13/135413/1
David Pursehouse [Sun, 20 Jan 2019 11:25:14 +0000 (20:25 +0900)]
Consistently import constants from StandardCharsets as static

Change-Id: I143c242c0e3299323ae166a59947b1195539e6bf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoLocalDiskRepositoryTestCase#createRepository: Default auto-close to false 12/135412/2
David Pursehouse [Sun, 20 Jan 2019 10:58:10 +0000 (19:58 +0900)]
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>
5 years agoUploadPack: Suppress false-positive resource leak warning 06/135406/1
David Pursehouse [Sun, 20 Jan 2019 08:41:59 +0000 (17:41 +0900)]
UploadPack: Suppress false-positive resource leak warning

Change-Id: Ida09cabb11740e6752a6f079d0528d38021fa2dd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoPushConnectionTest: Open TestRepository in try-with-resource 05/135405/1
David Pursehouse [Sun, 20 Jan 2019 08:34:21 +0000 (17:34 +0900)]
PushConnectionTest: Open TestRepository in try-with-resource

Change-Id: I539b3acea8da914fc745e54b0bf104cf344c181c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMergerTest: Open TestRepository in try-with-resource 04/135404/1
David Pursehouse [Sun, 20 Jan 2019 08:33:04 +0000 (17:33 +0900)]
MergerTest: Open TestRepository in try-with-resource

Change-Id: I1c4bd2fd5f0ad7112bd3ebe1506de3cf51231b36
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMergeCommandTest: Open TestRepository in try-with-resource 03/135403/1
David Pursehouse [Sun, 20 Jan 2019 08:29:33 +0000 (17:29 +0900)]
MergeCommandTest: Open TestRepository in try-with-resource

Change-Id: If620f6a98c5e8436a3edb4ee365ec02f41d0ea6a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoPackWriterTest: Open TestRepository in try-with-resource 02/135402/1
David Pursehouse [Sun, 20 Jan 2019 08:27:03 +0000 (17:27 +0900)]
PackWriterTest: Open TestRepository in try-with-resource

Change-Id: Ia4202c860b851bef5db72ea6781b3e6a32484e08
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoReceivePackAdvertiseRefsHookTest: Open TestRepository in try-with-resource 01/135401/1
David Pursehouse [Sun, 20 Jan 2019 08:17:50 +0000 (17:17 +0900)]
ReceivePackAdvertiseRefsHookTest: Open TestRepository in try-with-resource

Change-Id: I7ab1de3516ac542821275add908ee70c427d781b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSubmoduleStatusTest: Open TestRepository in try-with-resource 00/135400/1
David Pursehouse [Sun, 20 Jan 2019 08:13:43 +0000 (17:13 +0900)]
SubmoduleStatusTest: Open TestRepository in try-with-resource

Change-Id: Iebb6abd35fa5b084a4c044e416a448785a3c9291
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUploadPackTest: Open TestRepository in try-with-resource 99/135399/1
David Pursehouse [Sun, 20 Jan 2019 08:11:30 +0000 (17:11 +0900)]
UploadPackTest: Open TestRepository in try-with-resource

Change-Id: Id37a07b00584aa8a884fa11cd6f42a16b44e77f3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoPackParserTest: Open TestRepository in try-with-resource 98/135398/1
David Pursehouse [Sun, 20 Jan 2019 08:08:01 +0000 (17:08 +0900)]
PackParserTest: Open TestRepository in try-with-resource

Change-Id: Ie3521f40ac80bc58df95f9f5dc79d51b29380461
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSmartClientSmartServerTest: Open TestRepository in try-with-resource 97/135397/1
David Pursehouse [Sun, 20 Jan 2019 08:02:34 +0000 (17:02 +0900)]
SmartClientSmartServerTest: Open TestRepository in try-with-resource

Change-Id: If1351920398f574b5b93be55868c157c3cd15290
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoStop using deprecated methods of RemoteSetUrlCommand/RemoteRemoveCommand 96/135396/1
David Pursehouse [Sun, 20 Jan 2019 06:12:45 +0000 (15:12 +0900)]
Stop using deprecated methods of RemoteSetUrlCommand/RemoteRemoveCommand

Change-Id: I5234474b359a32bdae501b181f0726be2af1ec6a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSmartClientSmartServerTest: Stop using deprecated Repository#hasObject 95/135395/1
David Pursehouse [Sun, 20 Jan 2019 06:04:53 +0000 (15:04 +0900)]
SmartClientSmartServerTest: Stop using deprecated Repository#hasObject

Change-Id: I75d1105934aeaac89476603e15cf642a65a3acbe
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoDumbClientSmartServerTest: Open TestRepository in try-with-resource 94/135394/1
David Pursehouse [Sun, 20 Jan 2019 06:00:08 +0000 (15:00 +0900)]
DumbClientSmartServerTest: Open TestRepository in try-with-resource

Change-Id: Ica172a85ec9b7da1416ff1b22699809f2c8c9df7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoDumbClientDumbServerTest: Open TestRepository in try-with-resource 93/135393/1
David Pursehouse [Sun, 20 Jan 2019 05:58:35 +0000 (14:58 +0900)]
DumbClientDumbServerTest: Open TestRepository in try-with-resource

Change-Id: Iaf339ae739689d4528a079776d6e945ba9006368
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoDirCacheCheckoutTest: Open TestRepository in try-with-resource 92/135392/1
David Pursehouse [Sun, 20 Jan 2019 05:54:14 +0000 (14:54 +0900)]
DirCacheCheckoutTest: Open TestRepository in try-with-resource

Change-Id: Iaf18ce230d6bf9b8bcb1895dd1bd3e4eb267de10
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoHttpTestCase#fsck: Open TestRepository in try-with-resource 91/135391/1
David Pursehouse [Sun, 20 Jan 2019 05:42:42 +0000 (14:42 +0900)]
HttpTestCase#fsck: Open TestRepository in try-with-resource

Change-Id: Ibda8c9970322871abf0fcf1244977bed04eaedd2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoCheckoutCommandTest: Add comment to document intentionally empty catch block 90/135390/1
David Pursehouse [Sun, 20 Jan 2019 05:39:52 +0000 (14:39 +0900)]
CheckoutCommandTest: Add comment to document intentionally empty catch block

Change-Id: I5156c3c2de67be015ef1d785fcf6084919765635
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agopgm: Fix missing braces in Describe.run() 88/135388/1
Matthias Sohn [Sun, 20 Jan 2019 00:46:21 +0000 (01:46 +0100)]
pgm: Fix missing braces in Describe.run()

Change-Id: I09e777fd4e77869952d2614ac2cde508b96d61e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Describe command 09/135309/2
Matthias Sohn [Sun, 20 Jan 2019 00:45:38 +0000 (01:45 +0100)]
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>
5 years agopgm: Handle exceptions in Config command 08/135308/2
Matthias Sohn [Thu, 17 Jan 2019 23:15:32 +0000 (00:15 +0100)]
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>
5 years agopgm: Fix too wide lines in Commit.run() 87/135387/1
Matthias Sohn [Sun, 20 Jan 2019 00:38:36 +0000 (01:38 +0100)]
pgm: Fix too wide lines in Commit.run()

Change-Id: I695d1771b808217b0fbde29805e53a819d8c3303
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in Commit.run() 86/135386/1
Matthias Sohn [Sun, 20 Jan 2019 00:30:24 +0000 (01:30 +0100)]
pgm: Fix missing braces in Commit.run()

Change-Id: Ia9e7e846ba1abfdb490896e5bcb82e2c0039439c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Commit command 07/135307/2
Matthias Sohn [Sun, 20 Jan 2019 00:27:57 +0000 (01:27 +0100)]
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>
5 years agopgm: Handle exceptions in Clean command 02/135202/3
Matthias Sohn [Wed, 16 Jan 2019 23:31:58 +0000 (00:31 +0100)]
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>
5 years agopgm: Handle GitAPIException in Fetch command 01/135201/3
Matthias Sohn [Wed, 16 Jan 2019 17:02:39 +0000 (18:02 +0100)]
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>