]> source.dussan.org Git - jgit.git/log
jgit.git
6 years agoHandle Gerrit Change-Ids for merge commits 71/120871/4
Thomas Wolf [Fri, 6 Apr 2018 21:58:34 +0000 (23:58 +0200)]
Handle Gerrit Change-Ids for merge commits

Otherwise successful, non-conflicting merges will never get a
Gerrit Change-Id.

Bug: 358206
Change-Id: I9b599ad01d9f7332200c1d81a1ba6ce5ef990ab5
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoPushProcess: Remove unused import of HashMap 08/121208/1
David Pursehouse [Mon, 16 Apr 2018 14:51:32 +0000 (16:51 +0200)]
PushProcess: Remove unused import of HashMap

Bug: 533621
Change-Id: Ie125818d5fc8fef5800108db2ca21151d8d3bfa3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoConfigure WindowCache settings to use in JGit CLI 95/118595/3
Matthias Sohn [Sun, 4 Mar 2018 09:42:46 +0000 (10:42 +0100)]
Configure WindowCache settings to use in JGit CLI

Set the same defaults as in EGit.
Use mmap to map git packfiles into memory.

Change-Id: I7997b9123448a762192d7eeb55e01432549fba98
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge "Push: Ensure ref updates are processed in input order"
David Pursehouse [Fri, 13 Apr 2018 21:43:12 +0000 (17:43 -0400)]
Merge "Push: Ensure ref updates are processed in input order"

6 years agoMerge "Allow '@' as last character of ref"
Christian Halstrick [Fri, 13 Apr 2018 09:14:43 +0000 (05:14 -0400)]
Merge "Allow '@' as last character of ref"

6 years agoPush: Ensure ref updates are processed in input order 87/121087/4
Dave Borowitz [Thu, 12 Apr 2018 15:43:50 +0000 (11:43 -0400)]
Push: Ensure ref updates are processed in input order

Various places on the client side of the push were creating unordered
maps and sets of ref names, resulting in ReceivePack processing commands
in an order other than what the client provided. This is normally not
problematic for clients, who don't typically care about the order in
which ref updates are applied to the storage layer.

However, it does make it difficult to write deterministic tests of
ReceivePack or hooks whose output depends on the order in which commands
are processed, for example if informational per-ref messages are written
to a sideband.[1]

Add a test that ensures the ordering of commands both internally in
ReceivePack and in the output PushResult.

[1] Real-world example:
    https://gerrit-review.googlesource.com/c/gerrit/+/171871/1/javatests/com/google/gerrit/acceptance/git/PushPermissionsIT.java#149

Change-Id: I7f1254b4ebf202d4dcfc8e59d7120427542d0d9e

6 years agoAllow '@' as last character of ref 42/121042/1
Christian Halstrick [Thu, 12 Apr 2018 06:39:29 +0000 (08:39 +0200)]
Allow '@' as last character of ref

Previously @ was allowed e.g. in branch names, but not as the last
character. The case that @ is the last character was not handled.

Change-Id: Ic33870b22236f7a5ec7b54007f1b0cefd9354bfb

6 years agoDirCache: Use constant from StandardCharsets 96/120996/2
David Pursehouse [Wed, 11 Apr 2018 12:31:07 +0000 (21:31 +0900)]
DirCache: Use constant from StandardCharsets

Instead of hard-coding the encoding name, use the constant from
StandardCharsets. As a result it is no longer necessary to catch
the UnsupportedEncodingException.

Change-Id: I3cb6de921a78e05e2a894c220e0d5a5c85e172cc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUse Constants.CHARACTER_ENCODING in tests 82/120982/2
David Pursehouse [Wed, 11 Apr 2018 05:10:02 +0000 (14:10 +0900)]
Use Constants.CHARACTER_ENCODING in tests

Change-Id: Iba9fc991aee54fcb8b0dc5e5841da24c2d54dfc2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoLargePackedWholeObject: Refactor to open DfsReader in try-with-resource 81/120981/2
David Pursehouse [Wed, 11 Apr 2018 04:59:00 +0000 (13:59 +0900)]
LargePackedWholeObject: Refactor to open DfsReader in try-with-resource

Change-Id: Ia9557e6c1ab230dbe2e94e025a49e93159d8658c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDon't throw if a pre-push hook is ignored. 38/120438/3
Markus Duft [Thu, 29 Mar 2018 13:28:07 +0000 (15:28 +0200)]
Don't throw if a pre-push hook is ignored.

This breaks any scenario where native git (with LFS) clones a repository
(and thus installs the hook) and later on JGit is used to push changes.

Change-Id: I2a17753377265a0b612ba3451b9df63a577a1c38
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
6 years agoMerge branch 'stable-4.11' 87/120887/1
David Pursehouse [Mon, 9 Apr 2018 07:40:37 +0000 (16:40 +0900)]
Merge branch 'stable-4.11'

* stable-4.11:
  LFS: Fix potential NPE in LfsPrePushHook

Change-Id: If721bd18035870541d216d2dcd9d47484e9af3e5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoLFS: Fix potential NPE in LfsPrePushHook 54/119754/2
Markus Duft [Tue, 20 Mar 2018 07:40:14 +0000 (08:40 +0100)]
LFS: Fix potential NPE in LfsPrePushHook

The NPE occurred in conjunction with a symbolic ref (origin/HEAD).

Change-Id: I291636818a121ca00e0df25de5b6fc71a48d447f
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
6 years agoSilence API error for ObjectIdSerializer.readWithoutMarker() 03/120303/2
Thomas Wolf [Tue, 27 Mar 2018 20:11:57 +0000 (22:11 +0200)]
Silence API error for ObjectIdSerializer.readWithoutMarker()

Change-Id: I99111797253b04148c42c83e1ef3d2cc383cc627
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoMerge branch 'stable-4.11' 21/120221/2
Matthias Sohn [Mon, 26 Mar 2018 22:51:05 +0000 (00:51 +0200)]
Merge branch 'stable-4.11'

* stable-4.11:
  Remove package import for javax.servlet.http from org.eclipse.jgit
  Add missing @since tag and silence API error

Change-Id: I2783a15ead26ab19de31a8fb3bfb148ef19de91a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove package import for javax.servlet.http from org.eclipse.jgit 20/120220/1
Matthias Sohn [Mon, 26 Mar 2018 22:33:00 +0000 (00:33 +0200)]
Remove package import for javax.servlet.http from org.eclipse.jgit

This package import is unused.

Change-Id: I9f202bb3162736a1ef8054516f1a3145d3a7bb9b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoAdd missing @since tag and silence API error 19/120219/1
Matthias Sohn [Mon, 26 Mar 2018 22:35:40 +0000 (00:35 +0200)]
Add missing @since tag and silence API error

These methods were introduced for 4.11.1 so we have to silence the API
error adding API in a service release raises.

Change-Id: Ic847cebbed439912d3979ec2ec1809f77a28f61e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoSignificantly speed up FileTreeIterator on Windows 18/120118/4
Thomas Wolf [Sun, 18 Mar 2018 22:29:59 +0000 (23:29 +0100)]
Significantly speed up FileTreeIterator on Windows

Getting attributes of files on Windows is an expensive operation.
Windows stores file attributes in the directory, so they are
basically available "for free" when a directory is listed. The
implementation of Java's Files.walkFileTree() takes advantage of
that (at least in the OpenJDK implementation for Windows) and
provides the attributes from the directory to a FileVisitor.

Using Files.walkFileTree() with a maximum depth of 1 is thus a
good approach on Windows to get both the file names and the
attributes in one go.

In my tests, this gives a significant speed-up of FileTreeIterator
over the "normal" way: using File.listFiles() and then reading the
attributes of each file individually. The speed-up is hard to
quantify exactly, but in my tests I've observed consistently 30-40%
for staging 500 files one after another, each individually, and up
to 50% for individual TreeWalks with a FileTreeIterator.

On Unix, this technique is detrimental. Unix stores file attributes
differently, and getting attributes of individual files is not costly.
On Unix, the old way of doing a listFiles() and getting individual
attributes (both native operations) is about three times faster than
using walkFileTree, which is implemented in Java.

Therefore, move the operation to FS/FS_Win32 and call it from
FileTreeIterator, so that we can have different implementations
depending on the file system.

A little performance test program is included as a JUnit test (to be
run manually).

While this does speed up things on Windows, it doesn't solve the basic
problem of bug 532300: the iterator always gets the full directory
listing and the attributes of all files, and the more files there are
the longer that takes.

Bug: 532300
Change-Id: Ic5facb871c725256c2324b0d97b95e6efc33282a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoTransportHttp: Refactor to use try-with-resource and suppress resource warning 37/119737/3
David Pursehouse [Tue, 20 Mar 2018 02:37:30 +0000 (11:37 +0900)]
TransportHttp: Refactor to use try-with-resource and suppress resource warning

Change-Id: I130269e7c5e46aea2152dea6b02539529208eea2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAdd missing @since tags for new API 36/120136/3
Matthias Sohn [Sat, 24 Mar 2018 21:05:53 +0000 (22:05 +0100)]
Add missing @since tags for new API

These methods were added after 4.11 so strictly speaking they violate
semantic versioning since new API requires increasing the minor version
number. Hence pretend these methods were introduced in 5.0

Change-Id: I7793ead16577dc1f2ddea09ba6b055103c783555
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix API problem filter warnings 37/120137/3
Matthias Sohn [Sat, 24 Mar 2018 21:14:15 +0000 (22:14 +0100)]
Fix API problem filter warnings

Silence warnings for bundles which haven't broken API since 4.11 but
we increased major version to 5 since we always use the same version
for all jgit bundles

Change-Id: If4f9a6aa4ef21f9b511946c5fc4bd7c0af6094c4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove unused API problem filters 68/119468/2
David Pursehouse [Thu, 15 Mar 2018 06:46:54 +0000 (15:46 +0900)]
Remove unused API problem filters

Change-Id: I414ebba1db831686fd378dadcb7c4882eb323115
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDfsInserter#openStream: Suppress resource warning about DfsReader 38/119738/3
David Pursehouse [Tue, 20 Mar 2018 02:43:15 +0000 (11:43 +0900)]
DfsInserter#openStream: Suppress resource warning about DfsReader

DfsReader is not opened in a try-with-resource because in the case where
the method returns an ObjectStream.Filter, the DfsReader should only be
closed from within the Filter's close() method.

Suppress the resource warning.

Change-Id: Ifcaf5e4a326bd1d03c6331b476c645ca43943b34
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCloneCommand: Suppress resource warning about Repository 36/119736/2
David Pursehouse [Tue, 20 Mar 2018 02:28:18 +0000 (11:28 +0900)]
CloneCommand: Suppress resource warning about Repository

Repository is not opened in try-with-resource because it is wrapped
in a Git instance which should be closed by the caller. On exeptions
during fetch, it is explicitly closed in the catch blocks.

Suppress the warning with an explanatory comment.

Change-Id: Ib32c74ce39bb810077ab84db33002bdde806f3b6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRename RecursiveMergerTest and ResolveMergerTest to reduce confusion 60/119660/3
David Pursehouse [Mon, 19 Mar 2018 12:13:53 +0000 (21:13 +0900)]
Rename RecursiveMergerTest and ResolveMergerTest to reduce confusion

The class names imply that RecursiveMergerTest tests the RecursiveMerger
and ResolveMergerTest tests the ResolveMerger.

In fact, both of them include coverage of both strategies; the difference
is that RecursiveMergerTest is only testing criss-cross merges.

The tests cannot be combined into a single class because the criss-cross
test methods have additional data points.

Instead, rename the classes to more meaningful names.

Change-Id: I7ca8a03a3b7e351e2d4fcaca3b3186c098a3ca66
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoResolveMergerTest: Use @DataPoints instead of @DataPoint 59/119659/3
David Pursehouse [Mon, 19 Mar 2018 12:10:04 +0000 (21:10 +0900)]
ResolveMergerTest: Use @DataPoints instead of @DataPoint

Define strategiesUnderTest as an array of MergeStrategy using the
@DataPoints annotation, rather than two separate variables each
annotated as @DataPoint.

This makes the implementation consistent with RecursiveMergerTest.

Change-Id: I9f1d525b38cb59634ba054c7779dc4af1fc46e25
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSubmoduleSyncCommand: Refactor to open Repository in try-with-resource 67/119467/5
David Pursehouse [Thu, 15 Mar 2018 06:43:13 +0000 (15:43 +0900)]
SubmoduleSyncCommand: Refactor to open Repository in try-with-resource

Change-Id: I502904ff7dbe074f7bbcb2a56a17bf4729f4f4d3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSubmoduleUpdateCommand: Refactor to open Repository in try-with-resource 66/119466/5
David Pursehouse [Thu, 15 Mar 2018 05:27:01 +0000 (14:27 +0900)]
SubmoduleUpdateCommand: Refactor to open Repository in try-with-resource

Change-Id: I1a303fdfdb6823043fa6751c43eaeaf678f2e64f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTransportGitAnon: Suppress resource warning about Socket 64/119464/5
David Pursehouse [Thu, 15 Mar 2018 05:09:50 +0000 (14:09 +0900)]
TransportGitAnon: Suppress resource warning about Socket

Change-Id: Id1f5c0db4273324748a0ead2e6dac58d9114cf86
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFS#runProcess: Fix OutputStream left unclosed after IOException 63/119463/6
David Pursehouse [Thu, 15 Mar 2018 04:44:00 +0000 (13:44 +0900)]
FS#runProcess: Fix OutputStream left unclosed after IOException

The runProcess method creates an OutputStream that is not managed by
a try-with-resource because it's manually closed and any IOException
raised by the close() method is explicitly ignored.

Suppress the resource warning with an explanatory comment.

Enclose the call to StreamGobbler#copy in an inner try-block, and move
the call to close() inside its finally block. This prevents the stream
from being left unclosed if StreamGobbler#copy raises IOException.

Change-Id: Idca9adfc4d87e0989d787ad8239c055c0c849814
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge changes from topic 'If72b4b422-cleanup'
Jonathan Nieder [Fri, 23 Mar 2018 01:01:31 +0000 (21:01 -0400)]
Merge changes from topic 'If72b4b422-cleanup'

* changes:
  UploadPackTest: Fix name hiding introduced by If72b4b422
  Suppress non-localized string warnings introduced by If72b4b422

6 years agoscanPacks to return reftables even if no packs 28/120028/1
Minh Thai [Fri, 23 Mar 2018 00:11:45 +0000 (17:11 -0700)]
scanPacks to return reftables even if no packs

An empty repository may have a dangling symref HEAD pointing to
refs/heads/master.  In this case, there will be a reftable even though
there are no packs yet.

Change-Id: Ib759ffbbfc490953481853e74263dd46d2592888
Signed-off-by: Minh Thai <mthai@google.com>
6 years agoUploadPackTest: Fix name hiding introduced by If72b4b422 46/119646/2
David Pursehouse [Mon, 19 Mar 2018 08:02:16 +0000 (17:02 +0900)]
UploadPackTest: Fix name hiding introduced by If72b4b422

The local variable 'remote' hides the class scope variable
of the same name.

Change-Id: I7410c33678677ce2a14691772466d91e8139e3fa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSuppress non-localized string warnings introduced by If72b4b422 45/119645/2
David Pursehouse [Mon, 19 Mar 2018 07:58:05 +0000 (16:58 +0900)]
Suppress non-localized string warnings introduced by If72b4b422

Change-Id: I2e4544d715b4284f544a26f504d01159c5843160
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoPackWriter: Fix Eclipse errors about missing Javadoc 44/119644/2
David Pursehouse [Mon, 19 Mar 2018 07:55:35 +0000 (16:55 +0900)]
PackWriter: Fix Eclipse errors about missing Javadoc

Change If72b4b422 added a new method filterAndAddObject with a
partial Javadoc, which causes errors in Eclipse.

Since it's a private method, Javadoc is not strictly necessary, so
just convert it to a standard comment block.

Bug: 532540
Change-Id: I06aa79211d1223dccf6c931451ca885ca6d39cbc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoReflogWriter: Refactor to open FileOutputStream in try-with-resource 62/119462/2
David Pursehouse [Thu, 15 Mar 2018 04:32:47 +0000 (13:32 +0900)]
ReflogWriter: Refactor to open FileOutputStream in try-with-resource

Change-Id: I028ced10eecc99214a4c4a8055c379af72193f13
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoPushCommand: Suppress resource warning for Transport in for loop 83/119383/5
David Pursehouse [Wed, 14 Mar 2018 04:11:16 +0000 (13:11 +0900)]
PushCommand: Suppress resource warning for Transport in for loop

A list of Transport instances is provided by Transport.openAll, and
then iterated over in a for loop. Eclipse warns that the Transport
in the for-loop should be managed by try-with-resource.

The Transport is explicitly closed in the finally block, so just
suppress the warning.

Change-Id: I92b73cd90902637cf1ac1ab7b02b5ee5ed6bdb1e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.11' 61/119461/2
David Pursehouse [Fri, 16 Mar 2018 02:59:41 +0000 (11:59 +0900)]
Merge branch 'stable-4.11'

* stable-4.11:
  ObjectIdSerializer: Support serialization of known non-null ObjectId

Change-Id: Ie430fa2c5d13ae698d884a37d0d03884ebbf25ec
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTeach UploadPack to support filtering by blob size 76/110476/13
Jonathan Tan [Tue, 17 Oct 2017 22:48:53 +0000 (15:48 -0700)]
Teach UploadPack to support filtering by blob size

Teach UploadPack to advertise the filter capability and support a
"filter" line in the request, accepting blob sizes only, if the
configuration variable "uploadpack.allowfilter" is true. This feature is
currently in the "master" branch of Git, and as of the time of writing,
this feature is to be released in Git 2.17.

This is incomplete in that the filter-by-sparse-specification feature
also supported by Git is not included in this patch.

If a JGit server were to be patched with this commit, and a repository
on that server configured with RequestPolicy.ANY or
RequestPolicy.REACHABLE_COMMIT_TIP, a Git client built from the "master"
branch would be able to perform a partial clone.

Change-Id: If72b4b422c06ab432137e9e5272d353b14b73259
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
6 years agoSubmoduleStatusCommand: Open Repository in try-with-resource 87/119387/4
David Pursehouse [Wed, 14 Mar 2018 04:39:23 +0000 (13:39 +0900)]
SubmoduleStatusCommand: Open Repository in try-with-resource

Change-Id: Id65c8a94d43bc01e76733eb2ff87635d0f8a8dc2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRepositoryCache#registerRepository: Refactor to use try-with-resource 86/119386/4
David Pursehouse [Wed, 14 Mar 2018 04:37:44 +0000 (13:37 +0900)]
RepositoryCache#registerRepository: Refactor to use try-with-resource

Change-Id: Iaad45b66cc10ac267f6aed7999cc8dc8c07f92e6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRepoCommandSymlinkTest#testLinkFileBare: Use try-with-resource 85/119385/4
David Pursehouse [Wed, 14 Mar 2018 04:35:50 +0000 (13:35 +0900)]
RepoCommandSymlinkTest#testLinkFileBare: Use try-with-resource

Change-Id: I72756d92dc5ea54ad009dddb9cebbcd6d1a0b4f8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRepoCommandTest: Refactor to use try-with-resource 84/119384/4
David Pursehouse [Wed, 14 Mar 2018 04:34:44 +0000 (13:34 +0900)]
RepoCommandTest: Refactor to use try-with-resource

Change-Id: If37ce4447feb431169a75594194a7ef02e362d4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoObjectIdSerializer: Support serialization of known non-null ObjectId 56/119456/3
David Pursehouse [Wed, 14 Mar 2018 23:25:43 +0000 (08:25 +0900)]
ObjectIdSerializer: Support serialization of known non-null ObjectId

The implementation of ObjectIdSerializer, added in change I7599cf8bd,
is not equivalent to the original implementation in Gerrit [1].

The Gerrit implementation provides separate methods to (de)serialize
instances of ObjectId that are known to be non-null. In these methods,
no "marker" is written to the stream. Replacing Gerrit's implementation
with ObjectIdSerializer [2] broke persistent caches because it started
writing markers where they were not expected [3].

Since ObjectIdSerializer is included in JGit 4.11 we can't change the
existing #write and #read methods. Keep those as-is, but extend the
Javadoc to clarify that they support possibly null ObjectId instances.

Add new methods #writeWithoutMarker and #readWithoutMarker to support
the cases where the ObjectId is known to be non-null and the marker
should not be written to the serialization stream.

Also:

- Replace the hard-coded `0` and `1` markers with constants that can
  be linked from the Javadocs.

- Include the marker value in the "Invalid flag before ObjectId"
  exception message.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/9792
[2] https://gerrit-review.googlesource.com/c/gerrit/+/165851
[3] https://gerrit-review.googlesource.com/c/gerrit/+/165952

Change-Id: Iaf84c3ec32ecf83efffb306fdb4940cc85740f3f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoReceivePackAdvertiseRefsHookTest#testSuccess: Open TransportLocal in t-w-r 82/119382/2
David Pursehouse [Wed, 14 Mar 2018 04:05:41 +0000 (13:05 +0900)]
ReceivePackAdvertiseRefsHookTest#testSuccess: Open TransportLocal in t-w-r

Change-Id: I198ff2ff36de482445141b5ce489204a9c2f4933
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDfsPackCompactor: Open PackWriter in try-with-resource 81/119381/2
David Pursehouse [Wed, 14 Mar 2018 04:01:59 +0000 (13:01 +0900)]
DfsPackCompactor: Open PackWriter in try-with-resource

Change-Id: I2c7b3fdf6a51471c35434a6176865d622b13653d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDfsPackFile: Refactor getBitmapIndex to open ReadableChannel in try-with-resource 80/119380/2
David Pursehouse [Wed, 14 Mar 2018 03:15:38 +0000 (12:15 +0900)]
DfsPackFile: Refactor getBitmapIndex to open ReadableChannel in try-with-resource

Refactor getBitmapIndex to open ReadableChannel in try-with-resource
instead of closing the channel in the finally block.

The same cannot be done in copyPackThroughCache, so just suppress the
warning with an explanatory comment.

Change-Id: I9b95373d350728e85a159423d5ca80e8b215914d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoIndexDiff: Refactor to open Repository in try-with-resource 79/119379/2
David Pursehouse [Wed, 14 Mar 2018 03:10:50 +0000 (12:10 +0900)]
IndexDiff: Refactor to open Repository in try-with-resource

Change-Id: I667d685ccedc730e786f1e52323fdeba4b91af3e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDirCache: Suppress resource warning related to TemporaryBuffer 77/119377/3
David Pursehouse [Wed, 14 Mar 2018 01:56:18 +0000 (10:56 +0900)]
DirCache: Suppress resource warning related to TemporaryBuffer

In #writeTo, the TemporaryBuffer can't be opened in try-with-resource
because it's referenced in the finally block. Instead it is explicitly
closed within the try block. Suppress the warning with an explanatory
comment.

Change-Id: I02009f77f9630d5d55afc34eb86d304ff103b8b0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAdd SilentFileInputStream to allow ignoring exceptions raised by close() 94/119294/6
David Pursehouse [Tue, 13 Mar 2018 07:11:40 +0000 (16:11 +0900)]
Add SilentFileInputStream to allow ignoring exceptions raised by close()

There are several cases where a FileInputStream is opened outside of
a try-with-resource because we want to explicitly close it and ignore
any IOException that is raised by the close() method.

Introduce a helper class, SilentFileInputStream, that overrides the
close method and ignores the exceptions. This allows to open the stream
in a try-with-resource block and remove the explicit handling of the
close method.

Change-Id: I8612f948a1a5b3d1031344922ad75ce4492cfc61
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoWorkingTreeIterator#idSubmodule: Refactor to open Repository in try-with-resource 76/119376/2
David Pursehouse [Wed, 14 Mar 2018 01:19:06 +0000 (10:19 +0900)]
WorkingTreeIterator#idSubmodule: Refactor to open Repository in try-with-resource

Change-Id: I991f0096c833da721b98c1e0423a8dadc67cd64f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUploadPack: Suppress resource warning about PackWriter 75/119375/2
David Pursehouse [Wed, 14 Mar 2018 00:39:48 +0000 (09:39 +0900)]
UploadPack: Suppress resource warning about PackWriter

PackWriter is auto-closeable and should be opened in try-with-resource,
but this is not possible since the variable is being referenced in the
finally block before being explicitly closed there.

Suppress the warning and add an explanatory comment.

Change-Id: I161923f35142132234fd951c0146d3cb30920b7b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoShowPackDelta: Refactor to use try-with-resource 74/119374/2
David Pursehouse [Wed, 14 Mar 2018 00:35:08 +0000 (09:35 +0900)]
ShowPackDelta: Refactor to use try-with-resource

Remove the resource warning suppression and refactor the code to open
the TemporaryBuffer and InflaterInputStream in a try-with-resource.

Change-Id: I3082e5ac7565c5000d5a4364f750dd0a0952fc6e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSubmoduleWalk#forIndex: Suppress resource warning and update Javadoc 13/119313/4
David Pursehouse [Tue, 13 Mar 2018 11:31:38 +0000 (20:31 +0900)]
SubmoduleWalk#forIndex: Suppress resource warning and update Javadoc

SubmoduleWalk is auto-closeable, and Eclipse warns that is is not
managed by try-with-resource. However in this case the resource should
not be closed, because the caller needs to use it. Instead, it is the
responsibility of the caller to close it after use.

Update the Javadoc to clarify this, and suppress the warning.

Change-Id: Ib7ba349353bfd3341bdcbe4bb19abaeb9f3aeba5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSubmoduleWalk: Open Repository in try-with-resource 11/119311/4
David Pursehouse [Tue, 13 Mar 2018 11:24:45 +0000 (20:24 +0900)]
SubmoduleWalk: Open Repository in try-with-resource

Change-Id: Ib29aaf26b49aa94a5a7cc0b0264a0a93ecff0c16
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRepositoryFilter: Refactor doFilter to open Repository in try-with-resource 02/119302/4
David Pursehouse [Tue, 13 Mar 2018 08:55:05 +0000 (17:55 +0900)]
RepositoryFilter: Refactor doFilter to open Repository in try-with-resource

Change-Id: Ic4a056eebe567ff933519d6a805edb7e97c71b22
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoNetRC: Open BufferedReader in try-with-resource 16/119316/3
David Pursehouse [Tue, 13 Mar 2018 11:43:44 +0000 (20:43 +0900)]
NetRC: Open BufferedReader in try-with-resource

Change-Id: Ie0688b0ce19f657834a23438f112569a86491b3b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoPackParser: Refactor to open InputStream in try-with-resource 15/119315/3
David Pursehouse [Tue, 13 Mar 2018 11:41:36 +0000 (20:41 +0900)]
PackParser: Refactor to open InputStream in try-with-resource

Change-Id: I8d002ccc8f168f5891492a4c5742c82f8cb7a0b6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAutoLFInputStreamTest: Use try-with-resource 10/119310/3
David Pursehouse [Tue, 13 Mar 2018 11:20:09 +0000 (20:20 +0900)]
AutoLFInputStreamTest: Use try-with-resource

Change-Id: I162bfa6b2f87f2ce9154f3ed6bb628c4cda88f50
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDfsInserter: Refactor writePackIndex to use try-with-resource 01/119301/3
David Pursehouse [Tue, 13 Mar 2018 08:51:10 +0000 (17:51 +0900)]
DfsInserter: Refactor writePackIndex to use try-with-resource

Refactor to allow the temporary buffer to be opened in try-with-resource.

Change-Id: Id913e6c3ed3913fd5d79d66238b779e0c225b47d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAmazonS3: Refactor error method to avoid 'should be managed by try-with-resource... 92/119292/2
David Pursehouse [Tue, 13 Mar 2018 07:00:41 +0000 (16:00 +0900)]
AmazonS3: Refactor error method to avoid 'should be managed by try-with-resource' warning

Change-Id: I205fc1c77777870b0a036e52fa9954de5d9f60b5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoCommandCatalog: Simplify scan method using try-with-resource 91/119291/2
David Pursehouse [Tue, 13 Mar 2018 06:56:47 +0000 (15:56 +0900)]
CommandCatalog: Simplify scan method using try-with-resource

The IOExceptions caught in the nested try blocks are all ignored,
so we can just wrap them all up into a single try-with-resource
block.

Change-Id: Id85850b3f54c408af73063220e6fead20cb0fd80
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTransport: Simplify scan method using try-with-resource 90/119290/2
David Pursehouse [Tue, 13 Mar 2018 06:50:27 +0000 (15:50 +0900)]
Transport: Simplify scan method using try-with-resource

The IOExceptions caught in the nested try blocks are all ignored,
so we can just wrap them all up into a single try-with-resource
block.

Change-Id: I536d682f1017c5088b94ff9f98ffa2b7c783d8bf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUse CHARSET in FileOutputStream instead of hard-coded "UTF-8" 87/119287/4
David Pursehouse [Tue, 13 Mar 2018 05:21:29 +0000 (14:21 +0900)]
Use CHARSET in FileOutputStream instead of hard-coded "UTF-8"

Change-Id: I63ad25e1ebd94081c8848f4d21044cf9041f971d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoTemporaryBufferTest: Suppress "should be managed by try-with-resource" 97/119297/2
David Pursehouse [Tue, 13 Mar 2018 08:24:10 +0000 (17:24 +0900)]
TemporaryBufferTest: Suppress "should be managed by try-with-resource"

In most of the tests, the temporary buffer is explicitly destroyed in
a finally block after being closed. This is not possible if using the
try-with-resource construct, because the variable is not accessible in
the finally block scope.

Change-Id: I3bab30695ddd12e1a0ae107989638428fe3ef551
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoOpen auto-closeable resources in try-with-resource 86/119286/4
David Pursehouse [Tue, 13 Mar 2018 02:44:23 +0000 (11:44 +0900)]
Open auto-closeable resources in try-with-resource

When an auto-closeable resources is not opened in try-with-resource,
the warning "should be managed by try-with-resource" is emitted by
Eclipse.

Fix the ones that can be silenced simply by moving the declaration of
the variable into a try-with-resource.

In cases where we explicitly call the close() method, for example in
tests where we are testing specific behavior caused by the close(),
suppress the warning.

Leave the ones that will require more significant refcactoring to fix.
They can be done in separate commits that can be reviewed and tested
in isolation.

Change-Id: I9682cd20fb15167d3c7f9027cecdc82bc50b83c4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoImplement --force option in FetchCommand and CLI fetch command 85/119285/1
Matthias Sohn [Tue, 13 Mar 2018 01:20:29 +0000 (02:20 +0100)]
Implement --force option in FetchCommand and CLI fetch command

Change-Id: I42cdb57b8fb54ce466d1958391f12f911045327f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge "Introduce SshSupport to centralize SSH related utility code"
Matthias Sohn [Mon, 12 Mar 2018 23:52:43 +0000 (19:52 -0400)]
Merge "Introduce SshSupport to centralize SSH related utility code"

6 years agoIntroduce SshSupport to centralize SSH related utility code 51/118951/2
Markus Duft [Thu, 8 Mar 2018 07:29:03 +0000 (08:29 +0100)]
Introduce SshSupport to centralize SSH related utility code

As discussed with Thomas here:
https://git.eclipse.org/r/#/c/83506/31/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java@349

Move the code from ConfigureGerritAfterCloneTask to SshSupport and
eliminate the slightly modified copy of the code from
LfsConnectionFactory. Separate EGit commit will eliminate the code from
ConfigureGerritAfterCloneTask.

Change-Id: Ifb5adb1342e0fc1f2a70cddf693408d4e0ef7906
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
6 years agoUploadPack: Remove redundant suppression of deprecation warning 89/119189/1
David Pursehouse [Mon, 12 Mar 2018 01:52:03 +0000 (10:52 +0900)]
UploadPack: Remove redundant suppression of deprecation warning

Change-Id: I9a7f46e1da42fd86adedc18b3394d5f755722624
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoConsistently use Constants.CHARSET rather than StandardCharsets.UTF_8 47/118947/4
David Pursehouse [Thu, 8 Mar 2018 00:44:01 +0000 (09:44 +0900)]
Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8

Change-Id: I6714fc3666e1bced22abba94ceb700477349586e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoConstants: Initialize CHARSET and CHARACTER_ENCODING from StandardCharsets.UTF_8 45/118945/4
David Pursehouse [Thu, 8 Mar 2018 00:42:02 +0000 (09:42 +0900)]
Constants: Initialize CHARSET and CHARACTER_ENCODING from StandardCharsets.UTF_8

Change-Id: Ib4e0a35429892fa1581db09a9b77717120d03275
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRemove deprecated LfsProtocolServlet#getLargeFileRepository 28/119128/2
Matthias Sohn [Fri, 9 Mar 2018 23:57:57 +0000 (00:57 +0100)]
Remove deprecated LfsProtocolServlet#getLargeFileRepository

Use LfsProtocolServlet##getLargeFileRepository(LfsRequest, String,
String) instead.

Change-Id: If68d06f2e6edbf843dc9d3b4e3b99c33b0fab766
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated Lfs#Lfs(Path) 27/119127/2
Matthias Sohn [Fri, 9 Mar 2018 23:56:04 +0000 (00:56 +0100)]
Remove deprecated Lfs#Lfs(Path)

Use Lfs#Lfs(Repository) instead.

Change-Id: I7303987ed047b42fd1bac8e27ed49333080e556b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated StreamCopyThread#flush 26/119126/2
Matthias Sohn [Fri, 9 Mar 2018 23:54:51 +0000 (00:54 +0100)]
Remove deprecated StreamCopyThread#flush

StreamCopyThread: Do not let flush interrupt a write.
flush calls interrupt() to interrupt a pending read and trigger a
flush.  Unfortunately that interrupt() call can also interrupt a
pending write, putting Jsch in a bad state and triggering "Short read
of block" errors.

Change-Id: I11f8a014fd72df06617cc8731d992eb14cc32a67
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated SafeBufferedOutputStream 25/119125/2
Matthias Sohn [Fri, 9 Mar 2018 23:52:22 +0000 (00:52 +0100)]
Remove deprecated SafeBufferedOutputStream

Use Java 8 BufferedOutputStream instead. Java 8 fixed the silent flush
during close issue by FilterOutputStream (base class of
BufferedOutputStream) using try-with-resources to close the stream,
getting a behavior matching what JGit's SafeBufferedOutputStream
was doing

Change-Id: Ieeab59f49b44519585abda213d287b19c7863b17
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated EolCanonicalizingInputStream 24/119124/2
Matthias Sohn [Fri, 9 Mar 2018 23:50:21 +0000 (00:50 +0100)]
Remove deprecated EolCanonicalizingInputStream

Use AutoLFInputStream instead.

Change-Id: If3765c425eed3a52d0c6aa8c7ea4925bb2e87395
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated FileUtils#relativize(String, String) 23/119123/2
Matthias Sohn [Fri, 9 Mar 2018 23:49:14 +0000 (00:49 +0100)]
Remove deprecated FileUtils#relativize(String, String)

Use the more-clearly-named
FileUtils#relativizeNativePath(String, String)
instead, or directly call
FileUtils#relativizePath(String, String, String, boolean).

Change-Id: I9b56302c94630c75293d8cf5510e1d2f22f2b778
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated FileUtil using Java 7 NIO 22/119122/2
Matthias Sohn [Fri, 9 Mar 2018 23:46:47 +0000 (00:46 +0100)]
Remove deprecated FileUtil using Java 7 NIO

Change-Id: I180a7a0bf9fe36c42edab9fffc6c05d983c229a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated TreeWalk#getEolStreamType 21/119121/2
Matthias Sohn [Fri, 9 Mar 2018 23:45:27 +0000 (00:45 +0100)]
Remove deprecated TreeWalk#getEolStreamType

Use TreeWalk#getEolStreamType(OperationType) instead.

Change-Id: I0f102ddf36102ff55a71448e376ed08743da5d1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated FileTreeIterator(WorkingTreeIterator, File, FS) 20/119120/2
Matthias Sohn [Fri, 9 Mar 2018 23:44:11 +0000 (00:44 +0100)]
Remove deprecated FileTreeIterator(WorkingTreeIterator, File, FS)

Use FileTreeIterator#FileTreeIterator(FileTreeIterator, File, FS)
instead.

Change-Id: I675e14863a1a387e7da9fc5148feffaf55d4ad39
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated TransportHttp#httpOpen(String, URL) 19/119119/2
Matthias Sohn [Fri, 9 Mar 2018 23:40:52 +0000 (00:40 +0100)]
Remove deprecated TransportHttp#httpOpen(String, URL)

Use TransportHttp#httpOpen(String, URL, AcceptEncoding) instead.

Change-Id: I4ad423175daa5499caad9cccb88076d371331569
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated ResolveMerger#processEntry method 18/119118/2
Matthias Sohn [Fri, 9 Mar 2018 23:39:20 +0000 (00:39 +0100)]
Remove deprecated ResolveMerger#processEntry method

Change-Id: I687965f6e9f3bcafa28afd62621fea240b36939d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated Repository#getRef 17/119117/2
Matthias Sohn [Fri, 9 Mar 2018 23:37:07 +0000 (00:37 +0100)]
Remove deprecated Repository#getRef

Use Repository#exactRef(String) or Repository#findRef(String) instead.

Change-Id: I5c547a26604b4cd792111c699df5f3c9d955d3f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated BitmapBuilder#add 16/119116/2
Matthias Sohn [Fri, 9 Mar 2018 23:33:26 +0000 (00:33 +0100)]
Remove deprecated BitmapBuilder#add

Use BitmapBuilder#or or BitmapBuilder#addObject instead.

Change-Id: I4bd71a842cf9f6ba2f9a17015e8a36ac380bfd3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated LockFile(File, FS) constructor 14/119114/2
Matthias Sohn [Fri, 9 Mar 2018 23:02:35 +0000 (00:02 +0100)]
Remove deprecated LockFile(File, FS) constructor

Use org.eclipse.jgit.internal.storage.file.LockFile#LockFile(File)
instead.

Change-Id: I107d9879c02a2006799a238ccaddf87c89f33f77
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated IgnoreNode#isIgnored method 13/119113/2
Matthias Sohn [Fri, 9 Mar 2018 23:00:42 +0000 (00:00 +0100)]
Remove deprecated IgnoreNode#isIgnored method

Parameter negateFirstMatch is not honored anymore

Change-Id: Idff1a92643c1431c7e34a7730f8414135e1ac196
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix misspelled class name: EmtpyCommitException -> EmptyCommitException 71/100671/4
David Pursehouse [Tue, 19 Dec 2017 02:13:48 +0000 (11:13 +0900)]
Fix misspelled class name: EmtpyCommitException -> EmptyCommitException

Change-Id: I55196020146f26951988988c14ac9a6f85061ae2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoRemove deprecated Statistics, UploadPackLogger, UploadPackLoggerChain 15/119115/2
Matthias Sohn [Fri, 9 Mar 2018 23:31:07 +0000 (00:31 +0100)]
Remove deprecated Statistics, UploadPackLogger, UploadPackLoggerChain

Use PackStatistics and PostUploadHook and PostUploadHookChain instead.
Also remove
- UploadPack#getPackStatistics replaced by #getStatistics
- UploadPack#getLogger and UploadPack#setLogger

Change-Id: I70881c539af3094d68d594f19983dea0973604e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated StoredObjectRepresentationnotAvailableException ctor 12/119112/1
Matthias Sohn [Fri, 9 Mar 2018 22:57:36 +0000 (23:57 +0100)]
Remove deprecated StoredObjectRepresentationnotAvailableException ctor

Use #StoredObjectRepresentationNotAvailableException(ObjectToPack,
Throwable) instead.

Change-Id: I766e00bc7292c7bd025aa2d7c54f10d278c7fabd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove deprecated ArchiveCommand#putEntry method 11/119111/1
Matthias Sohn [Fri, 9 Mar 2018 22:55:43 +0000 (23:55 +0100)]
Remove deprecated ArchiveCommand#putEntry method

Use #putEntry(Closeable, ObjectId, String, FileMode, ObjectLoader)}
instead.

Change-Id: I2c58c07da00c6033c583eb2dc6c3a0889661f5f5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 5.0.0-SNAPSHOT builds 45/119045/1
Matthias Sohn [Thu, 8 Mar 2018 22:09:18 +0000 (23:09 +0100)]
Prepare 5.0.0-SNAPSHOT builds

Change-Id: I2d2f50ed8a12f310e7cac68eed5536bd460c403f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' 44/119044/1
Matthias Sohn [Thu, 8 Mar 2018 22:08:28 +0000 (23:08 +0100)]
Merge branch 'stable-4.11'

* stable-4.11:
  Prepare 4.11.1-SNAPSHOT builds
  JGit v4.11.0.201803080745-r

Change-Id: I225b9a6a9be6bda1d6fc8f605917645ff1fec852

6 years agoPrepare 4.11.1-SNAPSHOT builds 35/119035/1
Matthias Sohn [Thu, 8 Mar 2018 20:10:08 +0000 (21:10 +0100)]
Prepare 4.11.1-SNAPSHOT builds

Change-Id: Id9aa6b7e8f56de5183b6cd57ef0e790ec9debd4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.11.0.201803080745-r 96/118996/1 v4.11.0.201803080745-r
Matthias Sohn [Thu, 8 Mar 2018 12:43:46 +0000 (13:43 +0100)]
JGit v4.11.0.201803080745-r

Change-Id: Ie24a33bc8a24c30db06fe7b175f405efb95776ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRemove useless for(;;) loop 13/118713/2
Thomas Wolf [Mon, 5 Mar 2018 19:49:29 +0000 (20:49 +0100)]
Remove useless for(;;) loop

Change-Id: Ic9a7824cc178e92f44126acc8e77b0304b20ef4f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoFix DiffFormatter for diffs against working tree with autocrlf=true 97/117697/3
Thomas Wolf [Mon, 19 Feb 2018 22:42:46 +0000 (23:42 +0100)]
Fix DiffFormatter for diffs against working tree with autocrlf=true

The WorkingTreeSource produced an ObjectLoader that returned
inconsistent sizes: the file size in getSize(), but then a
correctly filtered smaller stream in openStream(). This resulted
either in an IOE "short read of block" or in an EOFException
depending on the resulting filtered size.

Fix this by ensuring that getSize() does return the size of the
filtered stream.

Bug: 530106
Change-Id: I7c7c85036047dc10030ed29c1d5a6c7f34f2bdff
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoMerge branch 'stable-4.10' 34/118934/1
Matthias Sohn [Wed, 7 Mar 2018 21:37:27 +0000 (22:37 +0100)]
Merge branch 'stable-4.10'

* stable-4.10:
  Don't subclass ThreadLocal to avoid memory leak in NLS
  Set context classloader to null in WorkQueue

Change-Id: Idacf9a15a27f8e1d73357a80ed11a02237eea49e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoLFS: Adjust some API to make integration into tools (EGit,...) easier 48/118648/4
Markus Duft [Mon, 5 Mar 2018 09:34:29 +0000 (10:34 +0100)]
LFS: Adjust some API to make integration into tools (EGit,...) easier

Make the install command accessible without requiring reflection.

Expose the isEnabled(Repository) API to be able to check if calling the
install command is required for a repository.

Change-Id: I17e6eaefb6afda17fea8162cbf0cb86a20506753
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMergeHeadMsgTest: Open FileOutputStream in try-with-resource 55/118855/1
David Pursehouse [Wed, 7 Mar 2018 05:49:21 +0000 (14:49 +0900)]
MergeHeadMsgTest: Open FileOutputStream in try-with-resource

Change-Id: I8efa549b98bf661665dc29d48d0e5661b0e8530c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>