]>
source.dussan.org Git - jgit.git/log
Thomas Wolf [Tue, 26 Feb 2019 10:53:49 +0000 (11:53 +0100)]
Remove duplicate externalized message
Instead of a new "unexpectedNlinkValue" message use the already
existing "failedAtomicFileCreation". Remove a stray double quote
from the latter.
Change-Id: I1ba5e9ea48d3f7615354b2ace2575883070b3206
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
David Pursehouse [Sun, 24 Feb 2019 23:50:03 +0000 (08:50 +0900)]
SHA1: Use externalized message in log
The non-externalized warning message says there is a "possible SHA-1
collision" but then the Sha1CollisionException is always thrown.
Replace the message with the existing externalised string that does
not say "possible".
Change-Id: I9773ec76b416c356e234a658fb119f98d33eac83
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
David Pursehouse [Sun, 24 Feb 2019 23:43:25 +0000 (08:43 +0900)]
JGitText: Remove unnecessary suffix from externalized message identifier
Change-Id: I7a3ade56c219826b81d33d1d52566a86ad2e853a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
David Pursehouse [Sun, 24 Feb 2019 23:24:19 +0000 (08:24 +0900)]
FS_POSIX: Externalize log message
Change-Id: Ida538e05c4595fdce99f1fa87469a3be60160adb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Matthias Sohn [Tue, 19 Feb 2019 22:19:55 +0000 (23:19 +0100)]
Update Orbit to S20190219190953
- Orbit milestone for 2019-03 M3
- fixes Apache httpclient 4.5.6
Bug: 544139
Change-Id: Ib225d90dd26f6f3665d4feacecfbba4a28251a0b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
David Pursehouse [Mon, 18 Feb 2019 23:33:11 +0000 (08:33 +0900)]
Update README
- Consistently refer to the project as "JGit", rather than "jgit".
- Convert the contribution guide link to markdown syntax.
Change-Id: I896b8112f3f1a77255883e0deb153e8937999a84
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Matthias Sohn [Mon, 18 Feb 2019 00:11:57 +0000 (01:11 +0100)]
Update README
Change-Id: Ibf77553f89871e34d7617d2a648fb0dc7904325d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
David Pursehouse [Mon, 18 Feb 2019 02:22:31 +0000 (11:22 +0900)]
Merge branch 'stable-5.3'
* stable-5.3:
ObjectDirectory: extra logging on packfile exceptions
Prepare 5.3.0-SNAPSHOT builds
JGit v5.3.0.
201901162155 -m1
Fix tools/version.sh
JGit v5.3.0.
201901161700 -m1
Change-Id: I3c511fbc08f21eec5bb49d443de33d43094da4a4
David Pursehouse [Mon, 18 Feb 2019 02:21:38 +0000 (11:21 +0900)]
Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
ObjectDirectory: extra logging on packfile exceptions
Change-Id: I4bbeb1d28ab042e3c6c74f7284f5d882ed034305
David Pursehouse [Mon, 18 Feb 2019 02:20:56 +0000 (11:20 +0900)]
Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
ObjectDirectory: extra logging on packfile exceptions
Change-Id: Id2fea30664d53b31ad026ee5ae06a5a24d731a52
Matthias Sohn [Sun, 17 Feb 2019 20:29:15 +0000 (21:29 +0100)]
Add missing @since tag for new API method getUpdateIndex
Change-Id: Idd4a580e241a9105a55bc6f0457ad02a35e55faf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
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>
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>
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>
Luca Milanesio [Mon, 11 Feb 2019 07:49:43 +0000 (07:49 +0000)]
ObjectDirectory: extra logging on packfile exceptions
Display extra logging, including the exception with the associated
stacktrace, whenever a packFile can't be read and thus removed
from the packlist.
Change-Id: I97a4e31dc427bfcc0baae438dcbe2dcd4704b824
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>