]> source.dussan.org Git - jgit.git/log
jgit.git
7 years agoReceivePackAdvertiseRefsHookTest: Don't close repositories in teardown 68/89668/2
David Pursehouse [Fri, 27 Jan 2017 08:08:09 +0000 (17:08 +0900)]
ReceivePackAdvertiseRefsHookTest: Don't close repositories in teardown

The repositories get added to the "toClose" set by createBareRepository,
and are then closed in the superclass's tearDown method.

Explicitly closing them in this test class's teardown causes the use
count to go negative when subsequently closed again by the superclass.

Change-Id: Idcbb16b4cf4bf0640d7e4ac15d1926d8a27c1251
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoRepoCommand#readFile: Don't call Git#getRepository() in try-with-resource 66/89666/2
David Pursehouse [Fri, 27 Jan 2017 05:44:14 +0000 (14:44 +0900)]
RepoCommand#readFile: Don't call Git#getRepository() in try-with-resource

Using try-with-resource means that close() will automatically be
called on the Repository object. However, according to the javadoc
of Git#close():

  If the repository was opened by a static factory method in this class,
  then this method calls Repository#close() on the underlying repository
  instance.

This means that Repository#close() is called twice, by Git.close()
and in the outer try-with-resource, leading to a corrupt use count.

Change-Id: I37ba517eb2cc67d1cd36813598772c70208d0bc9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoRepoCommandTest: Don't wrap create{Bare,Work}Directory in t-w-r 65/89665/2
David Pursehouse [Fri, 27 Jan 2017 06:51:55 +0000 (15:51 +0900)]
RepoCommandTest: Don't wrap create{Bare,Work}Directory in t-w-r

These methods add the created Repository into "toClose", and they are
then closed by LocalDiskRepositoryTestCase's tearDown method.

Calling them in try-with-resource causes them to first be closed in
the test method, and then again in tearDown, which results in the use
count going negative and a log message on the console.

While this is not a serious problem, having so many false positives
in the logs will potentially drown out real cases of Repository being
closed too many times.

Change-Id: Ib374445e101dc11cb840957b8b19ee1caf777392
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoLocalDiskRepositoryTestCase: Only add to toClose through access method 63/89663/2
David Pursehouse [Fri, 27 Jan 2017 03:05:12 +0000 (12:05 +0900)]
LocalDiskRepositoryTestCase: Only add to toClose through access method

Only using the access method means we only have one place where the
toClose set is modified, making it easier to debug either by adding
log statements or by setting a breakpoint.

Change-Id: I4f9f1774d5f2e10bcab381edfd84bb6ee0499a11
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoGitConstructionTest: Remove unnecessary calls to Repository.close() 62/89662/2
David Pursehouse [Fri, 27 Jan 2017 01:08:11 +0000 (10:08 +0900)]
GitConstructionTest: Remove unnecessary calls to Repository.close()

The repositories are already closed in the superclass teardown due
to being added to the "toClose" set.

Change-Id: I768ba8a02fc585907687caf37e2e283434016c04
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoMerge "LocalDiskRepositoryTestCase: Prevent duplicates in list of repos to close"
Matthias Sohn [Sat, 28 Jan 2017 16:45:19 +0000 (11:45 -0500)]
Merge "LocalDiskRepositoryTestCase: Prevent duplicates in list of repos to close"

7 years agoMerge "Remove unused org.apache.http.impl.client.cache requirement"
Andrey Loskutov [Sat, 28 Jan 2017 15:04:28 +0000 (10:04 -0500)]
Merge "Remove unused org.apache.http.impl.client.cache requirement"

7 years agoLocalDiskRepositoryTestCase: Prevent duplicates in list of repos to close 61/89661/1
David Pursehouse [Fri, 27 Jan 2017 02:32:18 +0000 (11:32 +0900)]
LocalDiskRepositoryTestCase: Prevent duplicates in list of repos to close

Change the "toClose" list to a set, which will not allow duplicate
entries. This reduces the number of false positive logs about corrupt
use count due to the same repository being closed more than once during
teardown.

Change-Id: I5ab0ff8b56e7f2b2c7aab5274d957708d26f42c5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoRepository: Include repository name when logging corrupt use count 60/89660/1
David Pursehouse [Fri, 27 Jan 2017 02:23:22 +0000 (11:23 +0900)]
Repository: Include repository name when logging corrupt use count

Logging the repository name makes it easier to track down what is
incorrectly closing a repository.

Change-Id: I42a8bdf766c0e67f100adbf76d9616584e367ac2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoRecord the estimated size of the pack files. 59/89259/8
Thirumala Reddy Mutchukota [Fri, 20 Jan 2017 22:31:01 +0000 (14:31 -0800)]
Record the estimated size of the pack files.

The Compacter and Garbage Collector will record the estimated size of
the newly going to be created compact, gc or garbage packs. This
information can be used by the clients to better make a call on how to
actually store the pack based on the approximated expected size.

Added a new protected method DfsObjDatabase.newPack(PackSource
packSource, long estimatedPackSize), so that the clients can override
this method to make use of the estimatedPackSize while creating a new
PackDescription object. The default implementation of this method is
equivalent to
newPack(packSource).setEstimatedPackSize(estimatedPackSize). I didn't
make it abstract because that would force all the existing sub classes
of DfsObjDatabase to implement this method. Due to this default
implementation, the estimatedPackSize is added to DfsPackDescription
using a setter instead of a constructor parameter (even though
constructor parameter would be a better choice as this value is set only
during the object creation).

Change-Id: Iade1122633ea774c2e842178a6a6cbb4a57b598b
Signed-off-by: Thirumala Reddy Mutchukota <thirumala@google.com>
7 years agoRemove unused org.apache.http.impl.client.cache requirement 93/89593/2
Andrey Loskutov [Thu, 26 Jan 2017 15:35:42 +0000 (16:35 +0100)]
Remove unused org.apache.http.impl.client.cache requirement

The package is not used by the plugin and seems to be missing in the
platform anyway under some conditions, see bug 508321 (newer
org.apache.httpcomponents.httpclient_4.5.2 does NOT include the package,
org.apache.httpcomponents.httpclient_4.3.6 does).

Change-Id: Ida5d926a611812b5177af651b3cf22f1b2519e02
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
7 years agoMerge branch 'stable-4.6' 69/89569/1
David Pursehouse [Thu, 26 Jan 2017 02:01:26 +0000 (11:01 +0900)]
Merge branch 'stable-4.6'

* stable-4.6:
  Update Orbit to S20170120205402 and com.jcraft.jsch to 0.1.54
  Fix preparation of 4.6.1-SNAPSHOT builds

Change-Id: Ifd1f81cb199a0b5bd35e8652cac116e377136b2d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoFixes Javadoc error in org.eclipse.jgit created with I59539ac 29/89529/4
Lars Vogel [Wed, 25 Jan 2017 16:05:19 +0000 (17:05 +0100)]
Fixes Javadoc error in org.eclipse.jgit created with I59539ac

Adds the param information to the private method. These are generated
via tooltip to resolve the compile errors.

Bug: 511043
Change-Id: I9ba551978eab750326d1a067b296e3ae93925871
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
7 years agoRemove @since tags from internal packages 62/89462/3
Jonathan Nieder [Tue, 24 Jan 2017 18:16:19 +0000 (10:16 -0800)]
Remove @since tags from internal packages

These packages don't use @since tags because they are not part of the
stable public API.  Some @since tags snuck in, though.  Remove them to
make the convention easier to find for new contributors and the
expectations clearer for users.

Change-Id: I6c17d3cfc93657f1b33cf5c5708f2b1c712b0d31

7 years agogc: loosen unreferenced objects 55/89455/4
David Turner [Tue, 24 Jan 2017 16:31:22 +0000 (11:31 -0500)]
gc: loosen unreferenced objects

An unreferenced object might appear in a pack.  This could only happen
because it was previously referenced, and then later that reference
was removed.  When we gc, we copy the referenced objects into a new
pack, and delete the old pack.  This would remove the unreferenced
object.  Now we first create a loose object from any unreferenced
object in the doomed pack.  This kicks off the two-week grace period
for that object, after which it will be collected if it's not
referenced.

This matches the behavior of regular git.

Change-Id: I59539aca1d0d83622c41aa9bfbdd72fa868ee9fb
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
7 years agoUpdate Orbit to S20170120205402 and com.jcraft.jsch to 0.1.54 60/89560/1
Matthias Sohn [Sat, 21 Jan 2017 08:32:00 +0000 (09:32 +0100)]
Update Orbit to S20170120205402 and com.jcraft.jsch to 0.1.54

CQ: 12553
Change-Id: Ie72b48d00f363e3dc05b9733018a6ddca32c3e6e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix preparation of 4.6.1-SNAPSHOT builds 59/89559/1
Matthias Sohn [Mon, 23 Jan 2017 19:29:20 +0000 (20:29 +0100)]
Fix preparation of 4.6.1-SNAPSHOT builds

Change-Id: Ib241c4f45192672712526599898c0bd0bd356436
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Mark ManifestParse.getFilteredProjects non-null 87/89387/2
Matthias Sohn [Mon, 23 Jan 2017 00:06:30 +0000 (01:06 +0100)]
[infer] Mark ManifestParse.getFilteredProjects non-null

Change-Id: I05653df7a0337443d2c8e53f47f4e95ec9ca1a9c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix potential NPE in DiffFormatter 86/89386/2
Matthias Sohn [Sun, 22 Jan 2017 23:53:50 +0000 (00:53 +0100)]
[infer] Fix potential NPE in DiffFormatter

Change-Id: Ia33e2af9ce3393d9173ca0dc7efefd86c965d8c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix potential NPE in CloneCommand 85/89385/2
Matthias Sohn [Sun, 22 Jan 2017 23:15:28 +0000 (00:15 +0100)]
[infer] Fix potential NPE in CloneCommand

Change-Id: Ie7eeba3ae719ff207c7535d535a9e0bd6c9e99e6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoImplement Bazel build for http-apache, lfs, lfs-server 64/89164/2
David Pursehouse [Fri, 20 Jan 2017 03:58:46 +0000 (12:58 +0900)]
Implement Bazel build for http-apache, lfs, lfs-server

Test plan:

  $ bazel build all

  $ unzip -t bazel-genfiles/all.zip
    Archive:  bazel-genfiles/all.zip
      testing: libhttp-apache.jar       OK
      testing: libjgit-archive.jar      OK
      testing: libjgit-lfs-server.jar   OK
      testing: libjgit-lfs.jar          OK
      testing: libjgit-servlet.jar      OK
      testing: libjgit.jar              OK
      testing: libjunit.jar             OK
    No errors detected in compressed data of bazel-genfiles/all.zip.

Change-Id: I9e6c60898ccc6d2a4557ec7544c297442a9702b4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoFormat Bazel files with buildifier 63/89163/2
David Pursehouse [Fri, 20 Jan 2017 04:03:03 +0000 (13:03 +0900)]
Format Bazel files with buildifier

Change-Id: I934114315d2c7cab917f1011b8e55c52367d429f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoChange StreamGobbler to Runnable to avoid unused Future 40/89240/2
Shawn Pearce [Fri, 20 Jan 2017 16:41:29 +0000 (08:41 -0800)]
Change StreamGobbler to Runnable to avoid unused Future

It can be considered a programming error to create a Future<T>
but do nothing with that object. There is an async computation
happening and without holding and checking the Future for done
or exception the caller has no idea if it has completed.

FS doesn't really care about these StreamGobblers finishing.
Instead use Runnable with execute(Runnable), which doesn't
return a Future.

Change-Id: I93b66d1f6c869e66be5c1169d8edafe781e601f6

7 years agoAdd missing @since tags on new API constants 51/89151/1
Matthias Sohn [Thu, 19 Jan 2017 22:56:25 +0000 (23:56 +0100)]
Add missing @since tags on new API constants

Change-Id: Ia8b861da07fba99644ccc9eb5578a46cc39600a1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agogc: Add options to preserve and prune old pack files 69/87969/5
James Melvin [Tue, 3 Jan 2017 18:41:56 +0000 (11:41 -0700)]
gc: Add options to preserve and prune old pack files

The new --preserve-oldpacks option moves old pack files into the
preserved subdirectory instead of deleting them after repacking.

The new --prune-preserved option prunes old pack files from the
preserved subdirectory after repacking, but before potentially
moving the latest old packfiles to this subdirectory.

These options are designed to prevent stale file handle exceptions
during git operations which can happen on users of NFS repos when
repacking is done on them. The strategy is to preserve old pack files
around until the next repack with the hopes that they will become
unreferenced by then and not cause any exceptions to running processes
when they are finally deleted (pruned).

Change-Id: If3f729f0d9ce920ee2c3e6acdde46f2068be61d2
Signed-off-by: James Melvin <jmelvin@codeaurora.org>
7 years agoMake ObjectDownloadListener public 70/89070/1
David Pursehouse [Thu, 19 Jan 2017 04:42:14 +0000 (13:42 +0900)]
Make ObjectDownloadListener public

The same was already done for ObjectUploadListener in I5b0fb1220.

Change-Id: Ie8a79f715fe69bed9331962fb478f7e35acf8680
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoImplement initial framework of Bazel build 27/84527/10
David Ostrovsky [Sun, 6 Nov 2016 08:06:54 +0000 (09:06 +0100)]
Implement initial framework of Bazel build

The initial implementation only builds the packages consumed by
Gerrit Code Review.

Test build and execution is not implemented.

We prefer to consume maven_jar custom rule from bazlets repository,
for the same reasons as in the Gerrit project:

* Caching artifacts across different clones and projects
* Exposing source classifiers and neverlink artifact

TEST PLAN:

  $ bazel build :all
  $ unzip -t bazel-genfiles/all.zip
  Archive: bazel-genfiles/all.zip
    testing: libjgit-archive.jar      OK
    testing: libjgit-servlet.jar      OK
    testing: libjgit.jar              OK
    testing: libjunit.jar             OK
  No errors detected in compressed data of bazel-genfiles/all.zip.

Change-Id: Ia837ce95d9829fe2515f37b7a04a71a4598672a0
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoNormalizer creating a valid branch name from a string 31/88131/9
Wim Jongman [Fri, 6 Jan 2017 01:27:43 +0000 (02:27 +0100)]
Normalizer creating a valid branch name from a string

Generic normalization method for a possible invalid branch name.
The method compresses dividers between spaces, then replaces spaces
and non word characters with underscores.

This method is needed in preparation for subsequent EGit changes.

Bug: 509878
Change-Id: Ic0d12f098f90f912a45bcc5693d6accf751d4e58
Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
7 years agoMerge "Fix StashApplyCommand for stashes containing untracked changes."
Christian Halstrick [Mon, 16 Jan 2017 08:44:57 +0000 (03:44 -0500)]
Merge "Fix StashApplyCommand for stashes containing untracked changes."

7 years agoFix StashApplyCommand for stashes containing untracked changes. 26/88726/3
Thomas Wolf [Sun, 15 Jan 2017 20:35:50 +0000 (21:35 +0100)]
Fix StashApplyCommand for stashes containing untracked changes.

If there are untracked changes, apply only the untracked tree
after a successful merge. The merge tree from merging untracked
with HEAD would also contain files already reset before (changes
in tracked files) and try to reset those again,leading to false
checkout conflicts.

Bug: 505804
Change-Id: Iaced4d277623334d11e3d1cca5969590d7c5093e
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
7 years agoFix possible InvalidObjectIdException in ObjectDirectory 78/88378/4
Marc Strapetz [Tue, 10 Jan 2017 15:28:54 +0000 (16:28 +0100)]
Fix possible InvalidObjectIdException in ObjectDirectory

ObjectDirectory.getShallowCommits should throw an IOException
instead of an InvalidArgumentException if invalid SHAs are present
in .git/shallow (as this file is usually edited by a human).

Change-Id: Ia3a39d38f7aec4282109c7698438f0795fbec905
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoAdd missing slf4j dependency in BUCK file for jgit-lfs-server 93/88693/2
Zhen Chen [Sat, 14 Jan 2017 06:27:36 +0000 (22:27 -0800)]
Add missing slf4j dependency in BUCK file for jgit-lfs-server

Change-Id: I0c7fcae123f94ebd8e5eb2700e3d601a1b199be9
Signed-off-by: Zhen Chen <czhen@google.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoSkip pack header bytes in DfsPackFile 92/88692/1
Zhen Chen [Sat, 14 Jan 2017 06:02:37 +0000 (22:02 -0800)]
Skip pack header bytes in DfsPackFile

The 12 bytes `PACK...` header is written in PackWriter before reading
CachedPack files. In DfsPackFile#copyPackBypassCache, the header was not
skipped when the first block is not in cache.

Change-Id: Ibbe2e564d36b79922a936657f286addb1044d237
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoLfsProtocolServlet#LfsRequest: Add operation type helper methods 06/88606/2
David Pursehouse [Fri, 13 Jan 2017 01:59:31 +0000 (10:59 +0900)]
LfsProtocolServlet#LfsRequest: Add operation type helper methods

Server implementations may need to check what type of operation is
being performed. Add helper methods to make it a bit simpler.

Change-Id: Ia33ed6699ebcb9000ef514ce79bcddbebf94e1c5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoExpose LFS operation strings as public constants 05/88605/2
David Pursehouse [Fri, 13 Jan 2017 01:54:04 +0000 (10:54 +0900)]
Expose LFS operation strings as public constants

So that they can be used either by third party LFS server implementations
or from within other parts of JGit's internal LFS implementation.

Change-Id: I58da6230247204588e017c010ce5b14e4615448d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoLfsProtocolServlet: Improve error on getLargeFileRepository failure 04/88604/3
David Pursehouse [Fri, 13 Jan 2017 01:41:27 +0000 (10:41 +0900)]
LfsProtocolServlet: Improve error on getLargeFileRepository failure

Externalize the error message and make it more specific. Also emit
an error log.

Change-Id: Ie7b1c90c54673bfb8e133fb0aa19a117d4ca6587
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd support for refusing LFS request due to invalid authorization 03/88603/2
David Pursehouse [Fri, 13 Jan 2017 01:08:29 +0000 (10:08 +0900)]
Add support for refusing LFS request due to invalid authorization

Add a new exception type that server implementations can throw when a
client attempts to make an unauthorized LFS operation, which will result
in HTTP 401 Unauthorized being returned to the client.

An example of this is a Gerrit server that rejects a request to perform
an LFS operation on a ref that is not visible to the caller.

As defined in the LFS spec [1] the request may include authentication,
and per RFC 2616 [2], "401 response indicates that authorization has been
refused for those credentials".

[1] https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md
[2] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Change-Id: I2aa22e2144df5fb7972df0e3285b77b08ecc63f2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoAdd LfsPointerFilter TreeFilter 00/59000/14
Dariusz Luksza [Thu, 22 Oct 2015 14:34:04 +0000 (16:34 +0200)]
Add LfsPointerFilter TreeFilter

Add new variation of TreeFilter in order to detect LFS pointer files in
the repository.

Additionally, update LfsPointer to support the legacy version URL [1] as
described in [2], and to allow arbitrary fields in the pointer file.

[1] https://hawser.github.com/spec/v1
[2] https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md

Change-Id: I621eb058619fb1b78888a54c4b60bb110a722fc3
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoPack refs/tags/ with refs/heads/ 72/87972/2
Shawn Pearce [Tue, 3 Jan 2017 22:23:57 +0000 (14:23 -0800)]
Pack refs/tags/ with refs/heads/

This fixes a nasty performance issue for repositories that have many
objects referenced through refs/tags/, but not in refs/heads/.
Situations like this can arise when a project has made releases like
refs/tags/v1.0, and then decides to orphan history and start over for
version 2. The v1.0 objects are not reachable from master anymore,
but are still live due to the v1.0 tag.

When tags are packed in the GC_OTHER pack, bitmaps are not able to
cover the repository's contents. This may cause very slow counting
times during git clone, as the server must enumerate the ancient
history under refs/tags/ to respond to the client.

Clients by default always ask for all tags when asking for all heads
during clone. This has been true since git-core commit 8434c2f1afedb
(Apr 27 2008), when clone was converted to a builtin. Including tags
in the main GC pack should still allow servers to benefit from the
fast full pack reuse path when serving a clone to a client.

Change-Id: I22e29517b5bc6fa3d6b19a19f13bef0c68afdca3

7 years agoGet rid of javax.servlet API dependency for core org.eclipse.jgit 57/87957/3
Marc Strapetz [Tue, 3 Jan 2017 17:12:05 +0000 (18:12 +0100)]
Get rid of javax.servlet API dependency for core org.eclipse.jgit

Change-Id: I57d5d4fab7e0b1bd4cf5f1850e8569c8ac5def88
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
7 years ago[findBugs] PackWriter.NONE should be final 18/87818/1
Matthias Sohn [Fri, 30 Dec 2016 00:19:58 +0000 (01:19 +0100)]
[findBugs] PackWriter.NONE should be final

Change-Id: I4b5621bcb4db82e0560408b3cde6f18b0cc55b29
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Remove reliance on default encoding in Base64 10/87810/1
Matthias Sohn [Thu, 29 Dec 2016 18:50:29 +0000 (19:50 +0100)]
[findBugs] Remove reliance on default encoding in Base64

Change-Id: I6901da975a86c460ce7c783a519669d8be8e23bb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Fix potential NPE in CleanFilter 85/87785/1
Matthias Sohn [Thu, 29 Dec 2016 00:09:03 +0000 (01:09 +0100)]
[findBugs] Fix potential NPE in CleanFilter

Change-Id: Ibc20e9fc16be62f61748b3f59f6d70c1ebf63671
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Fix potential NPE in ObjectDirectoryTest 84/87784/1
Matthias Sohn [Thu, 29 Dec 2016 00:06:06 +0000 (01:06 +0100)]
[findBugs] Fix potential NPE in ObjectDirectoryTest

Change-Id: I0307d1e9bbc0bfc8172eed10f8e93788d6e2c8b4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Fix potential NPE in GcPackRefsTest 83/87783/1
Matthias Sohn [Thu, 29 Dec 2016 00:04:25 +0000 (01:04 +0100)]
[findBugs] Fix potential NPE in GcPackRefsTest

Change-Id: I273c06b9b2ce36c8232803cb7f02d7f846ed49e5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Fix potential NPE in GC 82/87782/1
Matthias Sohn [Wed, 28 Dec 2016 23:58:40 +0000 (00:58 +0100)]
[findBugs] Fix potential NPE in GC

Change-Id: I59cda76b2c5039e08612f394ee4f7f1788578c49
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[findBugs] Fix potential NPE in DirCacheCheckoutTest 81/87781/1
Matthias Sohn [Wed, 28 Dec 2016 23:37:59 +0000 (00:37 +0100)]
[findBugs] Fix potential NPE in DirCacheCheckoutTest

Change-Id: I842cbdd14bf56cb2bd599255fe90a5a3aea0d304
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoRemove unused API warning filters 80/87780/1
Matthias Sohn [Wed, 28 Dec 2016 23:57:49 +0000 (00:57 +0100)]
Remove unused API warning filters

Change-Id: If6d343a55245219a652e35c9cfde69349dc09889
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix keep pack filename 76/87776/1
James Melvin [Tue, 27 Dec 2016 21:08:56 +0000 (14:08 -0700)]
Fix keep pack filename

Previously it was looking for a keep file with the name of a pack file
(extenstion included) appended with a '.keep'. However, the keep file
name should be the pack file name  with a '.keep' extension

Change-Id: I9dc4c7c393ae20aefa0b9507df8df83610ce4d42
Signed-off-by: James Melvin <jmelvin@codeaurora.org>
7 years agoPrepare 4.7.0-SNAPSHOT builds 52/87752/1
Matthias Sohn [Tue, 27 Dec 2016 00:31:15 +0000 (01:31 +0100)]
Prepare 4.7.0-SNAPSHOT builds

Change-Id: I20754d13007e6591d36aae5766f3a9a82b24e120
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge branch 'stable-4.6' 51/87751/1
Matthias Sohn [Tue, 27 Dec 2016 00:14:06 +0000 (01:14 +0100)]
Merge branch 'stable-4.6'

* stable-4.6:
  Update tycho version to 0.26
  Update maven plugins
  Skip javadoc generation for org.eclipse.jgit.http.test
  Prepare 4.6.1-SNAPSHOT builds
  JGit v4.6.0.201612231935-r

Change-Id: Ia70329af7ec8bdb6d8bd6f917e00024a3ea4ac1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoUpdate tycho version to 0.26 45/87745/1
Matthias Sohn [Mon, 26 Dec 2016 22:21:46 +0000 (23:21 +0100)]
Update tycho version to 0.26

Change-Id: I1cf3402c057de89d1afe161d2d4106896fa8753f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoUpdate maven plugins 29/87729/2
Matthias Sohn [Sat, 24 Dec 2016 14:50:39 +0000 (15:50 +0100)]
Update maven plugins

Change-Id: I2d18f69d25362f565df071c320970cbc973199cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoSkip javadoc generation for org.eclipse.jgit.http.test 28/87728/1
Matthias Sohn [Sat, 24 Dec 2016 14:50:22 +0000 (15:50 +0100)]
Skip javadoc generation for org.eclipse.jgit.http.test

This fixes the error the javadoc plugin raises when generating the maven
site for this bundle.

Change-Id: I72026aa33be86960747a246af4a70f6a91b40102
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoPrepare 4.6.1-SNAPSHOT builds 27/87727/1
Matthias Sohn [Sat, 24 Dec 2016 14:51:54 +0000 (15:51 +0100)]
Prepare 4.6.1-SNAPSHOT builds

Change-Id: I6b05a6f6c3f92365c272e1bdaf76093ca01f2d58
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoJGit v4.6.0.201612231935-r 21/87721/1 v4.6.0.201612231935-r
Matthias Sohn [Sat, 24 Dec 2016 00:42:38 +0000 (01:42 +0100)]
JGit v4.6.0.201612231935-r

Change-Id: Iaa88fe1b195dfe6be99a7b4cb064684e75563715
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoMerge branch 'stable-4.5' 20/87720/1
Matthias Sohn [Fri, 23 Dec 2016 23:29:31 +0000 (00:29 +0100)]
Merge branch 'stable-4.5'

* origin/stable-4.5:
  Fix one case of missing object

Change-Id: Ia6384f4be71086d5a0a8c42c7521220f57dfd086
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leak in IndexDiff 85/87385/2
Matthias Sohn [Mon, 19 Dec 2016 07:45:49 +0000 (08:45 +0100)]
[infer] Fix resource leak in IndexDiff

We only need the tree id to add it to a TreeWalk so change tree's type
to AnyObjectId.

Bug: 509385
Change-Id: I98dd5fef15cd173fe1fd84273f0f48e64e12e608
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leak in ObjectChecker 46/87446/2
Matthias Sohn [Tue, 20 Dec 2016 00:08:38 +0000 (01:08 +0100)]
[infer] Fix resource leak in ObjectChecker

Bug: 509385
Change-Id: I6b6ff5b721d959eb0708003a40c8f97d6826ac46
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix a resource leak in PackWriter 84/87384/1
Matthias Sohn [Mon, 19 Dec 2016 07:38:41 +0000 (08:38 +0100)]
[infer] Fix a resource leak in PackWriter

Bug: 509385
Change-Id: Ic8a82895fa39be73f1bd8427cfe9437be6fc4e3e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leaks in DfsInserter 83/87383/1
Matthias Sohn [Sun, 18 Dec 2016 23:02:43 +0000 (00:02 +0100)]
[infer] Fix resource leaks in DfsInserter

Bug: 509385
Change-Id: Id5dc40bb3fb9da97ea0795cca1f2bcdcde347767
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leak in ManifestParser 66/87366/5
Matthias Sohn [Sun, 18 Dec 2016 11:06:55 +0000 (12:06 +0100)]
[infer] Fix resource leak in ManifestParser

Bug: 509385
Change-Id: Icfe58ac2e5344546448a55ad14ec082356be968c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leak in RepoCommand 67/87367/5
Matthias Sohn [Sun, 18 Dec 2016 00:54:51 +0000 (01:54 +0100)]
[infer] Fix resource leak in RepoCommand

Bug: 509385
Change-Id: I30c427f0dd2fc1fceb6b003dfdee0a05efaefca9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leak in DirCache 65/87365/5
Matthias Sohn [Sun, 18 Dec 2016 00:42:24 +0000 (01:42 +0100)]
[infer] Fix resource leak in DirCache

Bug: 509385
Change-Id: I5f914c910ef3a7583594fb31c7757d3dddf6a05e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix SubmoduleWalk leaks in submodule commands 64/87364/4
Matthias Sohn [Sun, 18 Dec 2016 00:37:01 +0000 (01:37 +0100)]
[infer] Fix SubmoduleWalk leaks in submodule commands

Bug: 509385
Change-Id: I4cba81d8ea596800a40799dc9cb763fae01fe508
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leaks in SubmoduleAddCommand 63/87363/4
Matthias Sohn [Sun, 18 Dec 2016 00:33:58 +0000 (01:33 +0100)]
[infer] Fix resource leaks in SubmoduleAddCommand

Bug: 509385
Change-Id: I9d25cf117cfb19df108f5fe281232193fd898474
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leaks in RebaseCommand 62/87362/3
Matthias Sohn [Sun, 18 Dec 2016 00:24:56 +0000 (01:24 +0100)]
[infer] Fix resource leaks in RebaseCommand

Bug: 509385
Change-Id: I9fbdfda59f7bc577aab55dc92ff897b00b5cb050
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years ago[infer] Fix resource leak in BlameCommand 61/87361/2
Matthias Sohn [Sun, 18 Dec 2016 00:10:25 +0000 (01:10 +0100)]
[infer] Fix resource leak in BlameCommand

Bug: 509385
Change-Id: Ic57fd3bf940752229e35102e7761823f7d3d8732
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoIgnore infer output folder 60/87360/2
Matthias Sohn [Sun, 18 Dec 2016 00:26:29 +0000 (01:26 +0100)]
Ignore infer output folder

Infer [1] is a static code checker.

[1] http://fbinfer.com/

Change-Id: I880cefe0a20f6af88ab10f6e862fda44fbe0883d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoUpdate maven-source-plugin to 3.0.1 to fix OOM during build 76/87376/1
Matthias Sohn [Sun, 18 Dec 2016 09:37:47 +0000 (10:37 +0100)]
Update maven-source-plugin to 3.0.1 to fix OOM during build

Recently we frequently suffer from OutOfMemoryError when creating source
archives in the Maven build. maven-source-plugin 3.0.0 has a bug [1]
causing OOM which is fixed in 3.0.1.

[1] https://issues.apache.org/jira/browse/MSOURCES-94

Change-Id: Ie900bd546c42523c5a04e22bd3d3f510d2a81ca2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix one case of missing object 57/87057/1
Hector Oswaldo Caballero [Tue, 13 Dec 2016 12:38:39 +0000 (07:38 -0500)]
Fix one case of missing object

When a repository is being GCed and a concurrent push is received, there
is the possibility of having a missing object. This is due to the fact
that after the list of objects to delete is built, there is a window of
time when an unreferenced and ready to delete object can be referenced
by the incoming push. In that case, the object would be deleted because
there is no way to know it is no longer unreferenced. This will leave
the repository in an inconsistent state and most of the operations fail
with a missing tree/object error.

Given the incoming push change the last modified date for the now
referenced object, verify this one is still a candidate to delete
before actually performing the delete operation.

Change-Id: Iadcb29b8eb24b0cb4bb9335b670443c138a60787
Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com>
7 years agoFix FileSnapshot.isModified 38/86738/5
Christian Halstrick [Thu, 8 Dec 2016 14:44:23 +0000 (15:44 +0100)]
Fix FileSnapshot.isModified

FileSnapshot.isModified may have reported a file to be clean although it
was actually dirty.

Imagine you have a FileSnapshot on file f. lastmodified and lastread are
both t0. Now time is t1 and you
1) modify the file
2) update the FileSnapshot of the file (lastModified=t1, lastRead=t1)
3) modify the file again
4) wait 3 seconds
5) ask the Filesnapshot whether the file is dirty or not. It erroneously
answered it's clean.

Any file which has been modified longer than 2.5 seconds ago was
reported to be clean. As the test shows that's not always correct.

The real-world problem fixed by this change is the following:
* A gerrit server using JGit to serve git repositories is processing
fetch requests while simultaneously a native git garbage collection
runs on the repo.
* At time t1 native git writes temporary files in the pack folder
setting the mtime of the pack folder to t1.
* A fetch request causes JGit to search for new packfiles and JGit
remembers this scan in a Filesnapshot on the packs folder. Since the gc
is not finished JGit doesn't see any new packfiles.
* The fetch is processed and the gc ends while the filesystem timer is
still t1. GC writes a new packfile and deletes the old packfile.
* 3 seconds later another request arrives. JGit does not yet know about
the new packfile but is also not rescanning the pack folder because it
cached that the last scan happened at time t1 and pack folder's mtime is
also t1. Now JGit will not be able to resolve any object contained in
this new pack. This behavior may be persistent if objects referenced by
the ref/meta/config branch are affected so gerrit can't read permissions
stored in the refs/meta/config branch anymore and will not allow any
pushes anymore. The pack folder will not change its mtime and therefore
no rescan will take place.

Change-Id: I3efd0ccffeb97b01207dc3e7a6b85c6b06928fad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoDecide whether to "Accept-Encoding: gzip" on a request-by-request basis 47/85647/12
Zhen Chen [Wed, 23 Nov 2016 00:39:27 +0000 (16:39 -0800)]
Decide whether to "Accept-Encoding: gzip" on a request-by-request basis

When the reply is already compressed (e.g. a packfile fetched using dumb
HTTP), "Content-Encoding: gzip" wastes bandwidth relative to sending the
content raw. So don't "Accept-Encoding: gzip" for such requests.

Change-Id: Id25702c0b0ed2895df8e9790052c3417d713572c
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoConfigure max heap size for Maven build 06/86806/1
Matthias Sohn [Fri, 9 Dec 2016 10:02:10 +0000 (11:02 +0100)]
Configure max heap size for Maven build

We faced many OOM errors on Hudson recently, so increase maximum heap size.

Change-Id: I81d4d562a06afcd8b4ff7d1f69c4d7f12099afad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoUpgrade errorprone to 2.0.15 23/86423/3
David Pursehouse [Tue, 6 Dec 2016 05:02:42 +0000 (14:02 +0900)]
Upgrade errorprone to 2.0.15

Change-Id: I05d3e12178f8f0b5a687c8e09c2dcf80580acfb4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoReplace usage of deprecated EWAHCompressedBitmap.add(long) 84/86684/2
David Pursehouse [Thu, 8 Dec 2016 02:10:35 +0000 (11:10 +0900)]
Replace usage of deprecated EWAHCompressedBitmap.add(long)

The add(long) method was deprecated in favor of addWord(long) in
the 0.8.3 release of JavaEWAH [1].

[1] https://github.com/lemire/javaewah/commit/e443cf5e

Change-Id: I89c397ed02e040f57663d04504399dfdc0889626
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoExpose getObjectToTransfer method of FileLfsServlet 68/85668/3
Jacek Centkowski [Thu, 24 Nov 2016 09:58:14 +0000 (10:58 +0100)]
Expose getObjectToTransfer method of FileLfsServlet

Providing own implementation to doGet/doPut methods is troublesome when
this method is private.

Change-Id: I098cdc5cb90410eaaebc56c88c2d9e168584dd6d
Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoMerge branch 'stable-4.5' 32/86432/1
David Pursehouse [Tue, 6 Dec 2016 07:55:16 +0000 (16:55 +0900)]
Merge branch 'stable-4.5'

* stable-4.5:
  Use the same variable to check and extract LFS object id

Change-Id: I314bd4373f40843c68853b3999f60d85e08628d9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoUpgrade buck to latest version 17/86117/1
David Pursehouse [Thu, 1 Dec 2016 06:57:17 +0000 (15:57 +0900)]
Upgrade buck to latest version

The latest version removes dependency on `realpath` which is not
available by default on OSX.

This upgrades buck to the same version used on Gerrit master.

Change-Id: I584211986be4e64f68d4eb905c09d3c5d60133e7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
7 years agoFix merge-base calculation 80/85580/5
Christian Halstrick [Wed, 23 Nov 2016 11:52:16 +0000 (12:52 +0100)]
Fix merge-base calculation

Fix JGits merge-base calculation in case of inconsistent commit times.
JGit was potentially failing to compute correct merge-bases when the
commit times where inconsistent (a parent commit was younger than a
child commit). The code in MergeBaseGenerator was aware of the fact that
sometimes the discovery of a merge base x can occur after the parents of
x have been seen (see comment in #carryOntoOne()). But in the light of
inconsistent commit times it was possible that these parents of a
merge-base have already been returned as a merge-base.

This commit fixes the bug by buffering all commits generated by
MergeBaseGenerator. It is expected that this buffer will be small
because the number of merge-bases will be small. Additionally a new
flag is used to mark the ancestors of merge-bases. This allows to filter
out the unwanted commits.

Bug: 507584
Change-Id: I9cc140b784c3231b972bd2c3de61a789365237ab

7 years agoConfigure Maven to run tests concurrently by default 30/85730/1
Matthias Sohn [Thu, 24 Nov 2016 23:43:11 +0000 (00:43 +0100)]
Configure Maven to run tests concurrently by default

Maven 3.3.1 or later supports sharing project specific command line
options
https://maven.apache.org/docs/3.3.1/release-notes.html

Change-Id: I61ddf08ff8c0ebb76fc2e1d0a0cd5902c65f9469
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoEnable error-prone for the Maven build 29/85729/1
David Pursehouse [Fri, 18 Nov 2016 01:30:27 +0000 (17:30 -0800)]
Enable error-prone for the Maven build

- update maven-compiler-plugin to 3.6.0
- exclude InsecureCipherFactory from errorprone checks

See
https://maven.apache.org/guides/mini/guide-default-execution-ids.html#Example:_Configuring_compile_to_run_twice
https://groups.google.com/d/topic/error-prone-discuss/pzT45ZMCQOc/discussion

Change-Id: Ic16d3f15cf2ef40de62fe6bfe4b8b35f0c1edc4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix encoding of LFSPointer files 68/84668/4
Christian Halstrick [Tue, 8 Nov 2016 12:42:34 +0000 (13:42 +0100)]
Fix encoding of LFSPointer files

LFS pointer files have to be UTF-8 with \n as line ending character.
That is described in [1]. Fix JGit to follow this rules.

[1] https://github.com/github/git-lfs/blob/master/docs/spec.md

Bug: 507120
Change-Id: Ib6bd13f1cc17f1a3de125249b4f250b7b0692396

7 years agoUse the same variable to check and extract LFS object id 71/85671/1
Jacek Centkowski [Thu, 24 Nov 2016 10:32:48 +0000 (11:32 +0100)]
Use the same variable to check and extract LFS object id

It is easier to maintain when the same variable is used for both check
and extraction of LFS object id.

Change-Id: I5406f9bc4a085aa164c4565a9667ad2925105190
Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
7 years agoSpecify RevisionSyntaxException message in Repository#resolve 52/85552/3
Grace Wang [Wed, 23 Nov 2016 02:05:39 +0000 (21:05 -0500)]
Specify RevisionSyntaxException message in Repository#resolve

This does not address all cases where no message is specified, only
cases where Repository#isValidRefName returns false.

Change-Id: Ib88cdabfdcdf37be0053e06949b0e21ad87a9575
Signed-off-by: Grace Wang <gracewang92@gmail.com>
7 years agoAdd missing @since tags for new API 37/85637/1
Matthias Sohn [Wed, 23 Nov 2016 22:29:41 +0000 (23:29 +0100)]
Add missing @since tags for new API

Change-Id: I900d745195f58c067fadf209bb92cd3c852c59f4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agodump HTTP: Avoid being confused by Content-Length of a gzipped stream 45/85545/5
Zhen Chen [Tue, 22 Nov 2016 23:53:06 +0000 (15:53 -0800)]
dump HTTP: Avoid being confused by Content-Length of a gzipped stream

TransportHttp sets 'Accept-Encoding: gzip' to allow the server to
compress HTTP responses. When fetching a loose object over HTTP, it
uses the following code to read the response:

       InputStream in = openInputStream(c);
       int len = c.getContentLength();
       return new FileStream(in, len);

If the content is gzipped, openInputStream decompresses it and produces
the correct content for the object. Unfortunately the Content-Length
header contains the length of the compressed stream instead of the
actual content length. Use a length of -1 instead since we don't know
the actual length.

Loose objects are already compressed, so the gzip encoding typically
produces a longer compressed payload. The value from the Content-Length
is too high, producing EOFException: Short read of block.

Change-Id: I8d5284dad608e3abd8217823da2b365e8cd998b0
Signed-off-by: Zhen Chen <czhen@google.com>
Helped-by: Jonathan Nieder <jrn@google.com>
7 years agoMerge "Close input stream after use"
Jonathan Nieder [Tue, 22 Nov 2016 20:38:05 +0000 (15:38 -0500)]
Merge "Close input stream after use"

7 years agoFix content length in HttpClientConnection 27/85527/4
Zhen Chen [Tue, 22 Nov 2016 01:15:15 +0000 (17:15 -0800)]
Fix content length in HttpClientConnection

Per the interface specification, the getContentLength method should
return -1 if content length is unknown or greater than
Integer.MAX_VALUE.

For chunked transfer encoding, the content length is not included in the
header, hence will cause a NullPointerException when trying to parse the
content length header.

Change-Id: Iaa36b5c146a8d654e364635fa0bd2d14129baf17
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoClose input stream after use 29/85529/1
Zhen Chen [Tue, 22 Nov 2016 19:59:32 +0000 (11:59 -0800)]
Close input stream after use

The InputStream in FileStream in downloadPack is never closed.

Change-Id: I59975d0b8d51f4b3e3ba9d4496b254d508cb936d
Signed-off-by: Zhen Chen <czhen@google.com>
7 years agoDefine MonotonicClock interface for advanced timestamps 06/85106/9
Shawn Pearce [Wed, 16 Nov 2016 01:34:07 +0000 (17:34 -0800)]
Define MonotonicClock interface for advanced timestamps

MonotonicClock can be implemented to provide more certainity about
time than the standard System.currentTimeMillis() can provide. This
can be used by classes such as PersonIdent and Ketch to rely on
more certainity about time moving in a strictly ascending order.

Gerrit Code Review can also leverage this interface through its
embedding of JGit and use MonotonicClock and ProposedTimestamp to
provide stronger assurance that NoteDb time is moving forward.

Change-Id: I1a3cbd49a39b150a0d49b36d572da113ca83a786

7 years agoAdd Oxygen target platform and remove target platforms older than Mars 80/85180/2
Matthias Sohn [Wed, 16 Nov 2016 23:28:05 +0000 (00:28 +0100)]
Add Oxygen target platform and remove target platforms older than Mars

Change-Id: I196c3c95dafa5ea5f165d20aaac2ce07a2c53631
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoUpdate JavaEWAH to 1.1.6 04/77604/3
Dave Borowitz [Wed, 20 Jul 2016 14:16:26 +0000 (10:16 -0400)]
Update JavaEWAH to 1.1.6

Use Oxygen M3 Orbit repository which provides the bundles built using
the new orbit-recipe based build.

CQ: 11658
Change-Id: I7f3dcc966732b32830c75d5daa55383bd028d182
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoAdd missing @since tags for new API 21/85021/2
Matthias Sohn [Mon, 14 Nov 2016 23:57:00 +0000 (00:57 +0100)]
Add missing @since tags for new API

Change-Id: Iaf83f66637d6a13e4a6d096ba8529553af7e30ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
7 years agoFix cryptoVer constant name to CRYPTO_VER 17/85017/2
Shawn Pearce [Mon, 14 Nov 2016 22:52:46 +0000 (14:52 -0800)]
Fix cryptoVer constant name to CRYPTO_VER

Change-Id: I46c39f2eceb4d58e49bd6273b87711f35250ab5c

7 years agoRepositoryCache: simplify code 16/85016/2
Shawn Pearce [Mon, 14 Nov 2016 22:52:23 +0000 (14:52 -0800)]
RepositoryCache: simplify code

The type parameters can now be inferred when creating
ConcurrentHashMap.

A for loop over the keys of a ConcurrentHashMap doesn't
need to use an Iterator<Map.Entry>; loop syntax handles
this just fine over keySet().

Change-Id: I1f85bb81b77f7cd1caec77197f2f0bf78e4a82a1

7 years agoAdd missing @Override found by ErrorProne 15/85015/2
Shawn Pearce [Mon, 14 Nov 2016 22:51:08 +0000 (14:51 -0800)]
Add missing @Override found by ErrorProne

Change-Id: I585242507815aad4aa0103fd55a6c369e342ab33

7 years agoDeprecate SafeBufferedOutputStream 40/84940/4
Shawn Pearce [Sun, 13 Nov 2016 19:24:41 +0000 (11:24 -0800)]
Deprecate SafeBufferedOutputStream

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:

  try {
    flush();
  } finally {
    out.close();
  }

With Java 8 as the minimum required version to run JGit
it is no longer necessary to override close() or have
this class. Deprecate the class, and use the JRE's version
of close.

Change-Id: Ic0584c140010278dbe4062df2e71be5df9a797b3

7 years agoMerge "Support {get,set}GitwebDescription on InMemoryRepository"
David Pursehouse [Mon, 14 Nov 2016 22:54:15 +0000 (17:54 -0500)]
Merge "Support {get,set}GitwebDescription on InMemoryRepository"

7 years agoSupport {get,set}GitwebDescription on InMemoryRepository 10/85010/2
Shawn Pearce [Mon, 14 Nov 2016 21:59:59 +0000 (13:59 -0800)]
Support {get,set}GitwebDescription on InMemoryRepository

This simplifies testing for Gerrit Code Review where
application code is updating the repository description
and the test harness uses InMemoryRepository.

Change-Id: I9fbcc028ae24d90209a862f5f4f03e46bfb71db0