]> source.dussan.org Git - jgit.git/log
jgit.git
8 years agoFix config value get to return last instead of 1st just like git 96/72296/4
Marco Miller [Fri, 6 May 2016 20:19:42 +0000 (16:19 -0400)]
Fix config value get to return last instead of 1st just like git

Before this fix, getting the value of 'key' below used to return
value1. This fix makes it so that value3 gets returned instead,
just like native git's get.

[section]
  key = value1
  key = value2
  key = value3

Change-Id: Iccb24de9b63c3ad8646c909494ca3f8c9ed6e29c
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoRemove UTF-8 checking duplication in Config lib subclasses 15/72315/2
Marco Miller [Mon, 9 May 2016 16:36:00 +0000 (12:36 -0400)]
Remove UTF-8 checking duplication in Config lib subclasses

Change-Id: Ib9f0ae8207000a36c5bf1a92fcc2c32efc4c0984
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoUpdate Maven plugins 65/72365/1
Matthias Sohn [Sat, 7 May 2016 21:43:23 +0000 (23:43 +0200)]
Update Maven plugins

to the following versions:
build-helper-maven-plugin 1.10
eclipse-jarsigner-plugin 1.1.3
findbugs-maven-plugin 3.0.3
jacoco-maven-plugin 0.7.6.201602180812
maven-clean-plugin 3.0.0
maven-compiler-plugin 3.5.1
maven-javadoc-plugin 2.10.3
maven-pmd-plugin 3.6
maven-project-info-reports-plugin 2.9
maven-resources-plugin 2.7
maven-shade-plugin 2.4.3
maven-site-plugin 3.5.1
maven-source-plugin 3.0.0
maven-surefire-plugin 2.19.1
maven-surefire-report-plugin 2.19.1
tycho 0.25
tycho-extras 0.25
wagon-ssh 2.10

Change-Id: I4dc57de77ab7838964e8fe3de1d50f28d67fcf4b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix type parameter in javadoc in TestRepository.delete(String ref) 66/72166/1
Matthias Sohn [Thu, 5 May 2016 20:51:14 +0000 (22:51 +0200)]
Fix type parameter in javadoc in TestRepository.delete(String ref)

Type parameter T extends AnyObjectId in signature of update(String, T)

Change-Id: I9c13ddc572b8e94d5c7854f4de1f8206cb5e99ca
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge branch 'stable-4.3' 12/72112/2
Matthias Sohn [Wed, 4 May 2016 23:13:35 +0000 (01:13 +0200)]
Merge branch 'stable-4.3'

* stable-4.3:
  Scan loose ref before packed in case gc about to remove the loose
  Fix possible NPEs when reporting transport errors
  Fix calling of clean/smudge filters from Checkout,MergeCommands
  Fix ApplyCommand when result of patch is an empty file

Change-Id: I0dc76b7a8c87ce8e0386a1b9e0fa92a3aa62abf7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoScan loose ref before packed in case gc about to remove the loose 40/71240/4
Marco Miller [Wed, 20 Apr 2016 21:42:34 +0000 (17:42 -0400)]
Scan loose ref before packed in case gc about to remove the loose

Before this change, jgit used to read packed-refs before scanning
loose refs. That was not a problem if gc didn't run concurrently. When
gc did run concurrently with such refs reading, that order sometimes
broke the latter. This lead to reading an older version of a ref's
tip, which meant "losing" the real tip or commit. The specific
read-Vs-gc concurrency scenario which broke reading that way follows:

1. let ref R be in packed-refs and R' be in loose
2. jgit starts reading packed-refs
3. gc also starts its business around that very time
4. jgit still has the time to read R from packed-refs
5. as gc is not done yet updating packed-refs with R'
6. jgit then starts scanning loose refs (or is about to)
7. gc quickly ends up being done moving loose R' to packed-refs
8. so gc (quickly) removes loose refs
9. -while jgit is scanning loose refs, now gone
10. so jgit assumes no loose to consider => packed-refs winning
11. so jgit wrongfully returns R (from 4.) as the tip, instead of R'.

This fix switches the order so loose refs are scanned (secured) before
taking the time to read packed-refs. This way, knowledge of the
likelier tip is guaranteed for ref reading to return the true tip
- despite concurrent gc. If there is no loose ref to scan, jgit reads
packed-refs and lands on R' (or S), which it then returns, as
expected. The gerrit issue [1] should be solved by this fix.

[1] https://code.google.com/p/gerrit/issues/detail?id=2302

Change-Id: Ibd120120a361a3a6ed565f3836afc1db706fbcdd
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoTestRepository: Add delete() method 11/72111/2
Jonathan Nieder [Wed, 4 May 2016 22:48:36 +0000 (15:48 -0700)]
TestRepository: Add delete() method

Change-Id: Ib4841397ceab44bd38cf2f154314ac36ded73ae0

8 years agoMake BaseReceivePack.setAtomic public 09/72109/1
Jonathan Nieder [Wed, 4 May 2016 22:01:47 +0000 (15:01 -0700)]
Make BaseReceivePack.setAtomic public

This makes atomic more consistent with other properties like
allowNonFastForwards.

Change-Id: Ie3b41f14ffba1d0b206ffecc697377417daa6973

8 years agoReceivePack: Pass atomic setting from client to BatchRefUpdate 93/72093/1
Jonathan Nieder [Wed, 4 May 2016 21:00:42 +0000 (14:00 -0700)]
ReceivePack: Pass atomic setting from client to BatchRefUpdate

Change-Id: I0e4e6cef693e8138562f5ca345e0db61a8abef9c

8 years agoPersonIdent: Make appendSanitized public 50/71950/2
Dave Borowitz [Tue, 3 May 2016 20:18:52 +0000 (16:18 -0400)]
PersonIdent: Make appendSanitized public

Change-Id: I337c90fff3c013819a42a7622ac6bacc72828c07

8 years agoConfig: Improve documentation for setStringList 52/71652/2
Stefan Beller [Thu, 28 Apr 2016 22:18:35 +0000 (15:18 -0700)]
Config: Improve documentation for setStringList

Change-Id: Idccfa0dfd6db324236f7cb26ab28bdbd80581a8b
Signed-off-by: Stefan Beller <sbeller@google.com>
8 years agoPrepare Neon target platform 64/69964/5
Matthias Sohn [Mon, 4 Apr 2016 09:12:21 +0000 (11:12 +0200)]
Prepare Neon target platform

also use the Neon target platform as the default target platform.

Neon Eclipse platform requires BREE 8 so we have to use Java 8 at least
for the JGit packaging build (for the compiler settings we still stick
to source and target 1.7 since we want to still support Java 7)
otherwise unpacking platform pack200 archives will fail since they are
built using Java 8 and hence cannot be unpacked using Java 7's
unpack200.

Update org.junit from 4.11 to 4.11 and org.apache.ant from from 1.9.2 to
1.9.6 since the older versions are not available in Neon orbit version

Ignore a couple of tests in ResourceUtilTest which now fail [1] since
bug 476585 was fixed in Neon M6.

CQ: 10694
CQ: 11308
Change-Id: I1a99a3ac2148693e21c57df5aeb848035b52b97b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoPersonIdent: Strip some special chars from external strings 11/71711/2
Dave Borowitz [Fri, 29 Apr 2016 15:10:36 +0000 (11:10 -0400)]
PersonIdent: Strip some special chars from external strings

The special characters <> and '\n' interfere with parsing of
identities. C git strips these special characters, so we should too.

Rather than allocating extra strings by calling String#trim(), add a
few lines to our sanitization method to perform the same trimming as
described in String's Javadoc.

Change-Id: I96edcb93a2fc194ee354d60566d352299742a52f

8 years agoPersonIdent: Document that name and email aren't trimmed 10/71710/2
Dave Borowitz [Fri, 29 Apr 2016 14:47:17 +0000 (10:47 -0400)]
PersonIdent: Document that name and email aren't trimmed

This might be somewhat surprising behavior to users who might
naturally assume the following invariant:
  ident.equals(parseIdent(ident.toExternalString()))

This invariant does not hold since whitespace is only trimmed during
serialization. We don't want to mess with the strings during
initialization, as this is called during the highly-optimized commit
parsing codepath.

Change-Id: I081a603f0ac0e33167462244779b0ff3ad51e80c

8 years agoFix possible NPEs when reporting transport errors 98/71498/1
Christian Halstrick [Wed, 27 Apr 2016 07:47:28 +0000 (09:47 +0200)]
Fix possible NPEs when reporting transport errors

There was a bug in JGit which caused NPEs being thrown when Transport
errors should be reported. Avoid the NPE to let the original error show
up.

Change-Id: I9e1e2b0195bd61b7e531a09d0fc7bce109bd6515

8 years agoExpose the ObjectInserter that created an ObjectReader 59/71359/4
Dave Borowitz [Mon, 25 Apr 2016 17:36:46 +0000 (13:36 -0400)]
Expose the ObjectInserter that created an ObjectReader

We've found in Gerrit Code Review that it is common to pass around
both an ObjectReader (or more commonly a RevWalk wrapping one) and an
ObjectInserter. These code paths often assume that the ObjectReader
can read back any objects created by the ObjectInserter without
flushing. However, we previously had no way to enforce that constraint
programmatically, leading to hard-to-spot problems.

Provide a solution by exposing the ObjectInserter that created an
ObjectReader, when known. Callers can either continue passing both
objects and check:
  reader.getCreatedFromInserter() == inserter
or they can just pass around ObjectReader and extract the inserter
when it's needed (checking that it's not null at usage time).

Change-Id: Ibbf5d1968b506f6b47030ab1b046ffccb47352ea

8 years agoAdd ObjectReader.Filter, like in ObjectInserter 58/71358/2
Dave Borowitz [Mon, 25 Apr 2016 17:28:43 +0000 (13:28 -0400)]
Add ObjectReader.Filter, like in ObjectInserter

Change-Id: If34ad8185dc8192435e622995fdca598b86add7e

8 years agoFix calling of clean/smudge filters from Checkout,MergeCommands 33/70833/3
Christian Halstrick [Tue, 12 Apr 2016 12:38:37 +0000 (14:38 +0200)]
Fix calling of clean/smudge filters from Checkout,MergeCommands

When CheckoutCommand or MergeCommand is called then not in all situation
the treewalks have been prepared to support clean/smudge filters. Fix
this

Bug: 491505
Change-Id: Iab5608049221c46d06812552ab97299e44d59e64

8 years agoUpdate buck to e64a2e2ada022f81e42be750b774024469551398 19/71119/1
David Pursehouse [Thu, 21 Apr 2016 07:31:24 +0000 (16:31 +0900)]
Update buck to e64a2e2ada022f81e42be750b774024469551398

To align with the version used in Gerrit's master build.

Change-Id: I3b6e21bf367ad1fb3598dc06b968aee6187d5aed
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
8 years agoSupport per-BatchRefUpdate atomic transactions 62/70962/2
Dave Borowitz [Tue, 19 Apr 2016 13:24:18 +0000 (09:24 -0400)]
Support per-BatchRefUpdate atomic transactions

Repurpose RefDatabase#performsAtomicTransactions() slightly, to
indicate that the backend _supports_ atomic transactions, rather than
the current definition, which is that the backend always _uses_ atomic
transactions regardless of whether or not the caller actually wants
them. Allow BatchRefUpdate callers to turn off atomic transactions by
calling setAtomic(false). Defaulting to true means this is backwards
compatible.

Change-Id: I6df78d7df65ab147b4cce7764bd3101db985491c

8 years agoAdd .buckd to .gitignore 61/70961/1
Dave Borowitz [Tue, 19 Apr 2016 13:40:06 +0000 (09:40 -0400)]
Add .buckd to .gitignore

Change-Id: I527923e282808c905ae9acd128ecc8a5b33d34c7

8 years agoFix ApplyCommand when result of patch is an empty file 19/70819/1
Jon Schneider [Fri, 15 Apr 2016 21:37:32 +0000 (14:37 -0700)]
Fix ApplyCommand when result of patch is an empty file

Such hunks are identifiable by a zero value for "new start line". Prior
to the fix, JGit throws and ArrayIndexOutOfBoundsException on such
patches.

Change-Id: I4f3deb5e5f41a08af965fcc178d678c77270cddb
Signed-off-by: Jonathan Schneider <jkschneider@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix RefsUnreadableInMemoryRepository 14/70814/2
Matthias Sohn [Sat, 16 Apr 2016 13:57:23 +0000 (15:57 +0200)]
Fix RefsUnreadableInMemoryRepository

- fix classpath for Eclipse
- add missing license header
- remove unused import

Change-Id: If491fe60678f050f86319388170ac789085fcf5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix Buck build broken by 4812fda. 20/70720/2
Mike Edgar [Wed, 13 Apr 2016 02:23:08 +0000 (22:23 -0400)]
Fix Buck build broken by 4812fda.

Creates a source directory under org.eclipse.jgit.http.test
for the new support class.

Signed-off-by: Michael Edgar <adgar@google.com>
Change-Id: Ie49492c2bbe5c1db96ceb0dc06fa7cb9f927431a

8 years agoMake UploadPack observe exceptions reading refs 01/70701/3
Mike Edgar [Wed, 13 Apr 2016 02:23:08 +0000 (22:23 -0400)]
Make UploadPack observe exceptions reading refs

Now if refs are unreadable when serving an upload pack the handler
will fail due to the actual underlying failure. Previously all wants
would be rejected as invalid because Repository.getAllRefs() returned
an empty map.

Testing this required a new subclass of InMemoryRepository so that
an IOException could be injected at the correct time.

Signed-off-by: Michael Edgar <adgar@google.com>
Change-Id: Iac708b1db9d0ccce08c4ef5ace599ea0b57afdc0

8 years agoExpose conflicting files in CheckoutConflictException 04/68104/3
Ned Twigg [Sat, 28 Jun 2014 03:22:03 +0000 (20:22 -0700)]
Expose conflicting files in CheckoutConflictException

Change-Id: I5b3b7b0633354d5ccf0c6c320c0df9c93fdf8eeb
Signed-off-by: Ned Twigg <ned.twigg@diffplug.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Fix CommitCommand to be able to skip writing to RefLog"
Matthias Sohn [Mon, 11 Apr 2016 20:50:10 +0000 (16:50 -0400)]
Merge "Fix CommitCommand to be able to skip writing to RefLog"

8 years agoFix CommitCommand to be able to skip writing to RefLog 41/70241/3
Christian Halstrick [Fri, 8 Apr 2016 14:04:17 +0000 (16:04 +0200)]
Fix CommitCommand to be able to skip writing to RefLog

CommitCommand already provided a method to set the comment which should
be written into the reflog. The underlying RefUpdate class supported to
skip writing a reflog entry. But through the CommitCommand API it was
not possible to prevent writing a reflog entry. Fix this and allow
creating commits which don't occur in the reflog.

Change-Id: I193c53de71fb5958ea749c4bfa8360a51acc9b58

8 years agoPrepare 4.4.0-SNAPSHOT builds 67/70267/2
Matthias Sohn [Fri, 8 Apr 2016 15:47:29 +0000 (17:47 +0200)]
Prepare 4.4.0-SNAPSHOT builds

Change-Id: If3162f4cc4ae6319b9f1e3293549485b039cfe7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge branch 'stable-4.3' 61/70261/1
Matthias Sohn [Fri, 8 Apr 2016 15:30:28 +0000 (17:30 +0200)]
Merge branch 'stable-4.3'

* stable-4.3:
  Add lfs libraries to scripts for upload to Maven central
  Prepare 4.3.1-SNAPSHOT versions

Change-Id: Ieba46a2b12c893d6c626194310ab8dde5a2f1e6a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoAdd lfs libraries to scripts for upload to Maven central 55/70255/2
Matthias Sohn [Fri, 8 Apr 2016 15:10:16 +0000 (17:10 +0200)]
Add lfs libraries to scripts for upload to Maven central

Change-Id: I13d78fd57421cca32a965af37cc9571e77448e31
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoPrepare 4.3.1-SNAPSHOT versions 59/70259/1
Matthias Sohn [Thu, 7 Apr 2016 22:56:43 +0000 (00:56 +0200)]
Prepare 4.3.1-SNAPSHOT versions

Change-Id: I985828fd379e4596ae7f1c30a87e55df06a7924e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Prepare 4.3.1-SNAPSHOT versions"
Matthias Sohn [Fri, 8 Apr 2016 15:01:17 +0000 (11:01 -0400)]
Merge "Prepare 4.3.1-SNAPSHOT versions"

8 years agoFilter corrupt objects from DfsReader.selectObjectRepresentation() 95/70195/1
Terry Parker [Thu, 7 Apr 2016 23:24:10 +0000 (16:24 -0700)]
Filter corrupt objects from DfsReader.selectObjectRepresentation()

PackWriter.writeObject() can get into an infinite loop when corrupt
packs are present. When it finds a pack file with an object that can be
reused it calls DfsPackFile.copyAsIs(). If that method sees an invalid
CRC, it adds the object to the DfsPackFile's corrupt object list and
throws a CorruptObjectException, which it later catches as an
IOException and wraps in a
StoredObjectRepresentationNotAvailableException.
PackWriter.writeObjectImpl() catches that SORNAE and retries the
operation by calling DfsReader.selectObjectRepresentation(). But
currently that method returns the same object which was just seen to
be corrupt.

Change DfsPackFile.isCorrupt() from private to package private, and use
that method in DfsReader.selectObjectRepresentation() to filter out
corrupt objects.

The stack traces that show the problem are:
  org.eclipse.jgit.errors.CorruptObjectException.<init>(CorruptObjectException.java:113)
  org.eclipse.jgit.internal.storage.dfs.DfsPackFile.copyAsIs(DfsPackFile.java:624)
  org.eclipse.jgit.internal.storage.dfs.DfsReader.copyObjectAsIs(DfsReader.java:491)
  org.eclipse.jgit.internal.storage.pack.PackWriter.writeObjectImpl(PackWriter.java:1478)
  org.eclipse.jgit.internal.storage.pack.PackWriter.writeObject(PackWriter.java:1455)

  org.eclipse.jgit.internal.storage.dfs.DfsPackFile.getPackIndex(DfsPackFile.java:228)
  org.eclipse.jgit.internal.storage.dfs.DfsReader.findAllFromPack(DfsReader.java:476)
  org.eclipse.jgit.internal.storage.dfs.DfsReader.selectObjectRepresentation(DfsReader.java:455)
  org.eclipse.jgit.internal.storage.pack.PackWriter.writeObjectImpl(PackWriter.java:1492)
  org.eclipse.jgit.internal.storage.pack.PackWriter.writeObject(PackWriter.java:1455)

Change-Id: Iad7bbcaed1f11a6aa3b4f5af911a73a34c0fabfd
Signed-off-by: Terry Parker <tparker@google.com>
8 years agoPrepare 4.3.1-SNAPSHOT versions 44/70244/1
Matthias Sohn [Thu, 7 Apr 2016 22:56:43 +0000 (00:56 +0200)]
Prepare 4.3.1-SNAPSHOT versions

Change-Id: I52c98ba8fb3a303269a1f9380af114b6dd8c5009
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoJGit v4.3.0.201604071810-r 86/70186/1 v4.3.0.201604071810-r
Matthias Sohn [Thu, 7 Apr 2016 22:10:10 +0000 (00:10 +0200)]
JGit v4.3.0.201604071810-r

Change-Id: I902cdf1ff92ce8c6e9d80c4965d8d5bd8b9ac6c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoJGit v4.3.0.201604071045-r 43/70143/1
Matthias Sohn [Thu, 7 Apr 2016 14:41:24 +0000 (16:41 +0200)]
JGit v4.3.0.201604071045-r

Change-Id: Iafab78d6be34d31a13f979b7be67611135c0f8bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge branch 'master' into stable-4.3 00/70100/1
Matthias Sohn [Thu, 7 Apr 2016 11:06:14 +0000 (13:06 +0200)]
Merge branch 'master' into stable-4.3

* master:
  Remove repository from cache when it's closed
  Fix RefDirectory not closing resources
  Fix repository cache never closing repository

Change-Id: I9dc9d017806cba25125f69b53812cc3e062ef975
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoRemove repository from cache when it's closed 81/56281/3
Hugo Arès [Fri, 18 Sep 2015 18:05:23 +0000 (14:05 -0400)]
Remove repository from cache when it's closed

RepositoryCache has 2 methods to remove a repository from the cache but
they are never called when a repository is closed. Users of the cache
were expected to call one of those 2 methods but how could they have
called them at proper time without having visibility of the repository
usage count.

Ideally, I would have reworked the RepositoryCache to wrap any
repository it opens in a class that would be responsible to unregister
them from the cache when it's really closed, i.e. when usage counter
reaches 0. The problem preventing the wrapping solution is the
RepositoryCache.register method that allows to register an already
opened repository in the cache. Such repositories cannot be wrapped
because callers are still holding a reference on the unwrapped
repository.

Document that RepositoryCache.close method is removing the repository
from the cache as well as closing it and rework
RepositoryCache.unregister method to only remove the repository from the
cache. Use the latter to unregister repository when Repository.doClose
is getting executed.

Change-Id: Ia364816e4da8d7b6cfa72f10758ca31aa8a1f9db
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix RefDirectory not closing resources 02/55902/5
Hugo Arès [Tue, 8 Sep 2015 13:21:31 +0000 (09:21 -0400)]
Fix RefDirectory not closing resources

When repositories are opened using the RepositoryCache, they are kept in
memory and when the repository usage counter reaches 0, the
Repository.close method is called which then calls close method on its
reference and object databases.

The problem is that RefDirectory.close method was a no-op and the
reference database was kept in memory. This problem is only happening
when opening a repository using the RepositoryCache because it never
evicts repositories, it's just calling the close method.

Change-Id: Iacb961de8e8b1f5b37824bf0d1a4caf4c6f1233f
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
8 years agoFix repository cache never closing repository 98/55898/6
Hugo Arès [Fri, 4 Sep 2015 19:32:28 +0000 (15:32 -0400)]
Fix repository cache never closing repository

Repository has a usage counter that is initialized to 1 at
instantiation and this counter is decremented when Repository.close
method is called. There is also a Repository.incrementOpen method that
RepositoryCache uses to increment the usage count when it's returning a
repository that is already opened.

The problem was that RepositoryCache was incrementing the usage count
for repositories that it just opened or registered. The usage count was
2 when it should have been 1.

Incrementing usage count is now only be done for repository that are
served from the cache.

This bug is causing slow memory increase of our Gerrit server until the
server become slow. Even if the RepositoryCache is using SoftReference,
it seems that the JVM is not garbage collecting the repositories because
it's not yet on the edge of being out of memory.

To test this change, I replicated all repositories(11k) from Gerrit
master to one slave. The Gerrit master used memory after this test was
10GB without this change and 3.5GB with.

Change-Id: I86c7b36174e384f106b51fe92f306018fd1dbdf0
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
8 years agoMerge branch 'master' into stable-4.3 36/70036/1
Matthias Sohn [Wed, 6 Apr 2016 14:04:57 +0000 (16:04 +0200)]
Merge branch 'master' into stable-4.3

* master:
  Add config parameter gc.prunePackExpire for packfile expiration
  In TestRepository, use a consistent clock

Change-Id: I7ac568e650fbd191e48a8f1a4068af72deb242e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoEnable calling of smudge filters when checking out paths 21/69921/3
Christian Halstrick [Tue, 5 Apr 2016 14:04:39 +0000 (16:04 +0200)]
Enable calling of smudge filters when checking out paths

When checking out commits/branches JGit was triggering correctly
configured smudge filters. But when checking out paths (either from
index or from commits) JGit was not triggering smudge filters. Fix
CheckoutCommand to properly call filters.

Bug: 486560
Also-by: Pascal Krause <pascal.krausek@sap.com>
Change-Id: I5ff893054defe57ab12e201d901fe74e1376efea
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoPrepare 4.3-SNAPSHOT builds 61/69961/1
Matthias Sohn [Tue, 5 Apr 2016 21:09:29 +0000 (23:09 +0200)]
Prepare 4.3-SNAPSHOT builds

Change-Id: Ib831f8870938113bd5338763f90a07d5c108b1de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoImplement DIR_NO_GITLINKS 82/69882/1
Preben Ingvaldsen [Tue, 1 Mar 2016 19:37:54 +0000 (11:37 -0800)]
Implement DIR_NO_GITLINKS

Implement the DIR_NO_GITLINKS setting with the same functionality
it provides in cGit.

Bug: 436200
Change-Id: I8304e42df2d7e8d7925f515805e075a92ff6ce28
Signed-off-by: Preben Ingvaldsen <preben@puppetlabs.com>
8 years agoAdd config parameter gc.prunePackExpire for packfile expiration 28/69628/1
Christian Halstrick [Tue, 29 Mar 2016 14:41:07 +0000 (16:41 +0200)]
Add config parameter gc.prunePackExpire for packfile expiration

JGit's Garbage Collector is repacking relevant objects into new
packfiles and is afterwards deleting the now obsolete packfiles. But to
prevent problems caused by race conditions JGit was not deleting
packfiles when they are too young. The same mechanism as for loose
objects and the config parameter gc.pruneExpire was used.
But JGit was reusing the parameter gc.pruneExpire also for packfiles
which may cause a lot of filesystem consumption if gc.pruneExpire was
set to the default of 2 weeks. Only two weeks after packfile creation gc
was allowed to delete this packfile.

This change introduces a new config paramter gc.prunePackExpire with a
default of "1.hour". This parameter is used when packfiles are deleted.
Only packfiles older than the specified time can be deleted.

For loose objects the behaviour is not changed and only the old
parameter gc.pruneExpire is relevant.

Change-Id: I6209efb05678b15153bd22479dc13486907a44f8

8 years agoIn TestRepository, use a consistent clock 40/69340/2
Terry Parker [Fri, 25 Mar 2016 20:55:48 +0000 (13:55 -0700)]
In TestRepository, use a consistent clock

The default author and committer objects in TestRepository were
initialized statically and did not use the MockSystemReader passed into
the TestRepository ctor. Make these fields non-static and initialize
them with a consistent clock.

Also make the author and commiter name and email strings public for
tests that want to verify against them.

Change-Id: I88b444b96e22743001b32824d8e4e03c2239aa86
Signed-off-by: Terry Parker <tparker@google.com>
8 years agoJGit v4.3.0.201603230630-rc1 15/69115/1 v4.3.0.201603230630-rc1
Matthias Sohn [Wed, 23 Mar 2016 10:27:04 +0000 (11:27 +0100)]
JGit v4.3.0.201603230630-rc1

Change-Id: I10835e5aa3618e5033424595942cc1649152cb24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Make the FileLfsRepository thread safe"
Matthias Sohn [Tue, 22 Mar 2016 23:11:06 +0000 (19:11 -0400)]
Merge "Make the FileLfsRepository thread safe"

8 years agoMake the FileLfsRepository thread safe 53/69053/1
Saša Živkov [Tue, 22 Mar 2016 16:23:53 +0000 (17:23 +0100)]
Make the FileLfsRepository thread safe

The FileLfsRepository.out member could have been accessed from multiple
threads which would corrupt the content.

Don't store the AtomicObjectOutputStream in the FileLfsRepository.out but
move it to the ObjectUploadListener which is instantiated per-request.

Add a parallel upload test.

Change-Id: I62298630e99c46b500d376843ffcde934436215b
Signed-off-by: Saša Živkov <sasa.zivkov@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Add missing @Deprecated annotation"
Jonathan Nieder [Fri, 11 Mar 2016 22:58:11 +0000 (17:58 -0500)]
Merge "Add missing @Deprecated annotation"

8 years agoAdd missing @Deprecated annotation 60/68260/1
Jonathan Nieder [Fri, 11 Mar 2016 22:55:18 +0000 (14:55 -0800)]
Add missing @Deprecated annotation

Noticed by error-prone (http://errorprone.info/bugpattern/DepAnn).

Change-Id: If8dcc2dd6d7cabffc95e10f8357ce31c12cf6b1c

8 years agoFix wrong whitespaces. 58/68258/1
Yuxuan 'fishy' Wang [Fri, 11 Mar 2016 22:36:00 +0000 (14:36 -0800)]
Fix wrong whitespaces.

This change replaced some tabs with spaces introduced in
change I8b3765713599e34f1411f9bbc7f575ec7c2384e0.

Change-Id: Ia5c23b38c9fbbb46f150e527347b61c64c8d9e87
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
8 years agoAdd ignoreRemoteFailures option to RepoCommand 40/68240/5
Yuxuan 'fishy' Wang [Fri, 11 Mar 2016 19:44:49 +0000 (11:44 -0800)]
Add ignoreRemoteFailures option to RepoCommand

With ignoreRemoteFailures set to true, we can ignore remote failures
(e.g. the branch of a project described in the manifest file does not
exist), skip that project and continue to the next one, instead of fail
the whole operation.

Change-Id: I8b3765713599e34f1411f9bbc7f575ec7c2384e0
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
8 years agoIntroduce FileModeStrategy to FileTreeIterator 16/67916/5
Preben Ingvaldsen [Tue, 7 Jul 2015 12:43:27 +0000 (13:43 +0100)]
Introduce FileModeStrategy to FileTreeIterator

This commit introduces a FileModeStrategy to
the FileTreeIterator class.  This provides a way to
allow different modes of traversing a file tree;
for example, to control whether or not a nested
.git directory should be treated as a gitlink.

Bug: 436200
Change-Id: Ibf85defee28cdeec1e1463e596d0dcd03090dddd
Signed-off-by: Preben Ingvaldsen <preben@puppetlabs.com>
8 years agoMerge "Change visibility of DirCacheTree#getObjectId to public"
Matthias Sohn [Tue, 8 Mar 2016 01:11:59 +0000 (20:11 -0500)]
Merge "Change visibility of DirCacheTree#getObjectId to public"

8 years agoChange visibility of DirCacheTree#getObjectId to public 57/67857/2
Philipp Marx [Mon, 7 Mar 2016 21:55:46 +0000 (22:55 +0100)]
Change visibility of DirCacheTree#getObjectId to public

Allow access to the ObjectId of a DirCacheTree if known for low level
integration code.

Change-Id: I6f05b10c9ac781f5e8b38af4a19e653313c91fa8
Signed-off-by: Philipp Marx <smigfu@googlemail.com>
8 years agoAdd EOL stream type detection to TreeWalk 35/60635/24
Ivan Motsch [Thu, 25 Feb 2016 14:39:41 +0000 (15:39 +0100)]
Add EOL stream type detection to TreeWalk

TreeWalk provides the new method getEolStreamType. This new method can
be used with EolStreamTypeUtil in order to create a wrapped InputStream
or OutputStream when reading / writing files. The implementation
implements support for the git configuration options core.crlf, core.eol
and the .gitattributes "text", "eol" and "binary"

CQ: 10896
Bug: 486563
Change-Id: Ie4f6367afc2a6aec1de56faf95120fff0339a358
Signed-off-by: Ivan Motsch <ivan.motsch@bsiag.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix RebuildRefTree trying to add HEAD twice to RefTree 48/67848/1
Matthias Sohn [Fri, 4 Mar 2016 13:20:01 +0000 (14:20 +0100)]
Fix RebuildRefTree trying to add HEAD twice to RefTree

14dfa70520 fixed the problem that HEAD wasn't added to the reftree when
rebuilding the reftree in an empty repository where HEAD isn't yet
resolvable. Since non-resolvable refs are filtered out by
RefDatabase.getRefs(ALL) we have to add HEAD to the reftree explicitly
in this special case.

This fix resulted in another bug: rebuilding the reftree in a repository
which has a resolvable HEAD failed with a DirCacheNameConflictException
in RefTree.apply(). If HEAD is resolvable RefDatabase.getRefs(ALL) does
not filter out HEAD. This results in two identical CREATE commands for
HEAD which RefTree.apply() refuses to execute.

Fix this by no longer creating a duplicate CREATE command for HEAD.

See: I46cbc2611b9ae683ef7319dc46af277925dfaee5
Change-Id: I58dd6bcdef88820aa7de29761d43e2edfa18fcbe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix apply patch which did not work with non-ascii characters 69/62269/2
XinTong Wang [Tue, 8 Dec 2015 20:03:26 +0000 (15:03 -0500)]
Fix apply patch which did not work with non-ascii characters

Bug: 483943
Change-Id: If28f64053d20ab1bee54245f223e952dc2fe392c
Signed-off-by: XinTong Wang <xintong@ca.ibm.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoFix help text for option --enable of command debug-rebuild-ref-tree 34/67634/1
Matthias Sohn [Tue, 1 Mar 2016 22:18:08 +0000 (23:18 +0100)]
Fix help text for option --enable of command debug-rebuild-ref-tree

This fixes a MissingResourceException thrown when executing
jgit debug-rebuild-ref-tree --help

Change-Id: I637ea55084a913f5105ebf4cf2baef8b81877938
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoUpdate Mars orbit repository to R20160221192158 72/67472/1
Matthias Sohn [Fri, 26 Feb 2016 21:40:18 +0000 (22:40 +0100)]
Update Mars orbit repository to R20160221192158

This version fixes signing of Apache httplclient.

Change-Id: I81d7a643233386442bd31ee602669d2c88b68576
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoTests on Windows with URIish fail 34/67334/1
Ivan Motsch [Thu, 25 Feb 2016 14:39:41 +0000 (15:39 +0100)]
Tests on Windows with URIish fail

The reason is that URIish(URL) and URIish(String) make different parsing
of path / rawPath with regard to drive letters. /C:/... for URL and
C:/... for String. This patch fixes the issue.

Change-Id: I8e2013fff30b7bb198ff733c038e21366667b8a0
Signed-off-by: Ivan Motsch <ivan.motsch@bsiag.com>
8 years agoRemove the profiles for selecting the target platform 85/66885/1
Matthias Sohn [Thu, 18 Feb 2016 23:25:16 +0000 (00:25 +0100)]
Remove the profiles for selecting the target platform

Target platform can be configured directly, e.g.:
  $ mvn clean install -Dtarget-platform=jgit-4.6

Set the default to use the Mars target platform.

Change-Id: Ib6075af19be88fa418ecbe4dd7a217d9879e178a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoAdd Neon target platform 81/66881/1
Matthias Sohn [Thu, 18 Feb 2016 22:43:20 +0000 (23:43 +0100)]
Add Neon target platform

Change-Id: I24cceef84a9351b84ca46635a3898de113f1046c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoRemove unused package export from bundle org.eclipse.jgit.lfs.test 76/66876/1
Matthias Sohn [Thu, 18 Feb 2016 22:34:03 +0000 (23:34 +0100)]
Remove unused package export from bundle org.eclipse.jgit.lfs.test

This may have caused the spurious compile errors sometimes observed in
Eclipse since org.eclipse.jgit.lfs.lib is a split package to enable
testing package private code in bundle org.eclipse.jgit.lfs.

Change-Id: I0294448965de8ad8c254b26382386ef2b9f6e863
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Support Amazon S3 based storage for LFS"
Sasa Zivkov [Wed, 17 Feb 2016 16:54:14 +0000 (11:54 -0500)]
Merge "Support Amazon S3 based storage for LFS"

8 years agoSupport Amazon S3 based storage for LFS 25/64625/11
Matthias Sohn [Wed, 3 Feb 2016 10:34:51 +0000 (11:34 +0100)]
Support Amazon S3 based storage for LFS

Add a storage implementation storing large objects in Amazon S3.
The AmazonS3Repository pre-signs download and upload requests.

AWS access and secret key are expected to be in the
$HOME/.aws/credentials file in the following format:

[default]
  accessKey = ...
  secretKey = ...

Use AWS version 4 request signing [1] because it is more secure and
supported by all regions. The version 3 signing is not supported in
newer regions.

In follow up changes we should:

- implement getVerifyAction() and do actual verification. Subclasses of
S3Repository can implement caching for object meta data (size) in order
to avoid extra roundtrips to S3. Verification should ensure that meta
data store and content of S3 storage are in sync

- HEAD request used in S3Repository.getSize() seems to always return
Content-length 0 in contrast to the documentation [2]. So getSize() does
detect if the object exists in S3 or not but in case the object exists
it always returns size 0

[1] http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
[2] https://forums.aws.amazon.com/thread.jspa?threadID=223616

Change-Id: Ic47f094928a259e5264c92b3aacf6d90210907a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
8 years agoIntroduce specific WantNotValidException for servers 26/66726/1
Shawn Pearce [Wed, 17 Feb 2016 00:41:51 +0000 (16:41 -0800)]
Introduce specific WantNotValidException for servers

Capture the internal "want X not valid" state as a specific subclass
of PackProtocolException, allowing this to be more easily identified
in server stack traces and wrapper application code.

Change-Id: I4b1adb7497f396432da420b0f600ad25a261f912

8 years agosmart HTTP server: Pass along "want X not valid" to client 24/66724/1
Shawn Pearce [Tue, 16 Feb 2016 23:09:05 +0000 (15:09 -0800)]
smart HTTP server: Pass along "want X not valid" to client

If the client sends a SHA-1 that the server does not recognize echo
this back to the client with an explicit error message instead of
the generic "internal server error".

This was always the intent of the implementation but it was being
dropped on smart HTTP due to the UploadPackServlet catching the
PackProtocolException, discarding the buffered message UploadPack
meant to send, and sending along a generic message instead.

Change-Id: I8d96b064ec655aef64ac2ef3e01853625af32cd1

8 years agoMerge branch 'stable-4.2' 60/66660/1
Matthias Sohn [Tue, 16 Feb 2016 00:06:02 +0000 (01:06 +0100)]
Merge branch 'stable-4.2'

* stable-4.2:
  Revert "Fix warnings about unchecked conversion of MergeResult"

Change-Id: I31c2e0679ad4cff77190858ac9a570d04841c386
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Revert "Fix warnings about unchecked conversion of MergeResult"" into stable-4.2
Shawn Pearce [Tue, 16 Feb 2016 00:00:48 +0000 (19:00 -0500)]
Merge "Revert "Fix warnings about unchecked conversion of MergeResult"" into stable-4.2

8 years agoRevert "Fix warnings about unchecked conversion of MergeResult" 59/66659/1
Shawn Pearce [Mon, 15 Feb 2016 23:45:55 +0000 (18:45 -0500)]
Revert "Fix warnings about unchecked conversion of MergeResult"

This reverts commit 979fa19110df0906a82e92e32d7d3ccf7eca3712.
Breaks API.

Change-Id: I54af657898d49f64d6906fe3edfb6b08e996d901

8 years agoMerge branch 'stable-4.2' 58/66658/1
Matthias Sohn [Mon, 15 Feb 2016 22:27:28 +0000 (23:27 +0100)]
Merge branch 'stable-4.2'

* stable-4.2:
  Don't use deprecated LockFile constructor
  Fix warnings about unchecked conversion of MergeResult
  MockServletConfig: Fix warning about unchecked conversion of Enumeration
  HugeFileTest: Make Git a class member and open in try-with-resource
  Suppress "unchecked cast" warnings related to UploadPackFactory.DISABLED
  DiffAlgorithms: Fix warnings about variable hiding
  DirCacheBasicTest: Open ObjectInserter.Formatter in try-with-resource
  DirCacheBuilderIteratorTest: Open TreeWalk in try-with-resource
  DirCacheCGitCompatabilityTest: Open TreeWalk in try-with-resource
  DirCacheCheckoutMaliciousPathTest: Open Git and RevWalk in t-w-r
  DirCacheIteratorTest: Open TreeWalk instances in try-with-resource
  ForPathTest: Open TreeWalk in try-with-resource
  GitConstructionTest: Open Git instance in try-with-resource
  IndexDiffTest: Open Git instances in try-with-resources
  ManifestParserTest: Don't use deprecated StringBufferInputStream
  InMemoryRepository: Remove unused RevWalk from batch method signature
  IndexModificationTimesTest: Open Git instances in try-with-resource
  InterIndexDiffFilterTest: Open TreeWalk in try-with-resource
  LockFileTest: Open Git instance in try-with-resource
  JGit v4.1.2.201602141800-r
  MergeCommandTest: Use JUnit's assume to check preconditions
  MergeCommandTest: Open Git instances in try-with-resource

Change-Id: Ie5dba6b9132a29e86958a04fa2b76465bcd2c6b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge "Allow deletion of HEAD ref if the repository is bare."
Shawn Pearce [Mon, 15 Feb 2016 18:02:04 +0000 (13:02 -0500)]
Merge "Allow deletion of HEAD ref if the repository is bare."

8 years agoMerge changes I13672371,I95074358 into stable-4.2
Shawn Pearce [Mon, 15 Feb 2016 17:59:32 +0000 (12:59 -0500)]
Merge changes I13672371,I95074358 into stable-4.2

* changes:
  MergeCommandTest: Use JUnit's assume to check preconditions
  MergeCommandTest: Open Git instances in try-with-resource

8 years agoDon't use deprecated LockFile constructor 04/66604/1
David Pursehouse [Mon, 15 Feb 2016 09:44:24 +0000 (18:44 +0900)]
Don't use deprecated LockFile constructor

Change-Id: Ibc3e2f3372e1a65732dd6d3c71cec53fb1aa15e2
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoFix warnings about unchecked conversion of MergeResult 02/66602/1
David Pursehouse [Mon, 15 Feb 2016 09:22:53 +0000 (18:22 +0900)]
Fix warnings about unchecked conversion of MergeResult

Change-Id: I1490b2209fa7b39676849c624adbc262a672f6df
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoMockServletConfig: Fix warning about unchecked conversion of Enumeration 01/66601/1
David Pursehouse [Mon, 15 Feb 2016 09:21:49 +0000 (18:21 +0900)]
MockServletConfig: Fix warning about unchecked conversion of Enumeration

Change-Id: Ic5ce6d220e3b644032819ce4b2f31c669be1cdb9
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoHugeFileTest: Make Git a class member and open in try-with-resource 98/66598/2
David Pursehouse [Mon, 15 Feb 2016 08:41:05 +0000 (17:41 +0900)]
HugeFileTest: Make Git a class member and open in try-with-resource

There's only one test method in this module and it's quite long, so
rather than using a try-with-resource and having to indent a huge
block of existing code, make the Git a member variable that gets
initialised and closed in @Before and @After annotated methods.

The methods are named 'before' and 'after' rather than the conventional
'setUp' and 'tearDown' so as not to conflict with the names of the
existing methods in LocalDiskRepositoryTestCase.

Change-Id: I5a4a9b59f244c450dbcae9fdde7d9e0f0cd24e6f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoSuppress "unchecked cast" warnings related to UploadPackFactory.DISABLED 96/66596/1
David Pursehouse [Mon, 15 Feb 2016 08:36:00 +0000 (17:36 +0900)]
Suppress "unchecked cast" warnings related to UploadPackFactory.DISABLED

Change-Id: Id74694e18fec326df2b04eb796b46ccc6484b23f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoDiffAlgorithms: Fix warnings about variable hiding 95/66595/1
David Pursehouse [Mon, 15 Feb 2016 08:29:20 +0000 (17:29 +0900)]
DiffAlgorithms: Fix warnings about variable hiding

Local variables/parameters named 'db' and 'cmp' were hiding class
member variables of the same name.

Change-Id: I98b770587aaf73744a93e6a3ee33d131a9fa91e9
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoDirCacheBasicTest: Open ObjectInserter.Formatter in try-with-resource 93/66593/1
David Pursehouse [Mon, 15 Feb 2016 08:19:17 +0000 (17:19 +0900)]
DirCacheBasicTest: Open ObjectInserter.Formatter in try-with-resource

Change-Id: Ie4b3e5ad9616bc56b6d8d2476d1e6c6319c1a0aa
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoDirCacheBuilderIteratorTest: Open TreeWalk in try-with-resource 92/66592/1
David Pursehouse [Mon, 15 Feb 2016 08:17:17 +0000 (17:17 +0900)]
DirCacheBuilderIteratorTest: Open TreeWalk in try-with-resource

Change-Id: I94836315918924cba9a2b5be6b9ae417cb2ad215
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoDirCacheCGitCompatabilityTest: Open TreeWalk in try-with-resource 91/66591/1
David Pursehouse [Mon, 15 Feb 2016 08:16:00 +0000 (17:16 +0900)]
DirCacheCGitCompatabilityTest: Open TreeWalk in try-with-resource

Change-Id: I81a8bd2aba7eb0a6efaea5d6f7720aa725052157
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoDirCacheCheckoutMaliciousPathTest: Open Git and RevWalk in t-w-r 90/66590/1
David Pursehouse [Mon, 15 Feb 2016 08:14:09 +0000 (17:14 +0900)]
DirCacheCheckoutMaliciousPathTest: Open Git and RevWalk in t-w-r

Change-Id: Iacb4e25f0ada74b1a01e448216cb02c7ec18b2d7
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoDirCacheIteratorTest: Open TreeWalk instances in try-with-resource 89/66589/1
David Pursehouse [Mon, 15 Feb 2016 08:12:29 +0000 (17:12 +0900)]
DirCacheIteratorTest: Open TreeWalk instances in try-with-resource

Change-Id: If23597acaebf2295b85411bf87bc0292d5dc789e
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoForPathTest: Open TreeWalk in try-with-resource 88/66588/1
David Pursehouse [Mon, 15 Feb 2016 08:09:09 +0000 (17:09 +0900)]
ForPathTest: Open TreeWalk in try-with-resource

Change-Id: Ie4d0eb9c0fe1d8b8f41da161e701137cd7dd178f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoGitConstructionTest: Open Git instance in try-with-resource 87/66587/1
David Pursehouse [Mon, 15 Feb 2016 08:07:22 +0000 (17:07 +0900)]
GitConstructionTest: Open Git instance in try-with-resource

Change-Id: Iddf658acd1c78161d6028cfcfb7e5c73534ae40b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoIndexDiffTest: Open Git instances in try-with-resources 86/66586/1
David Pursehouse [Mon, 15 Feb 2016 08:03:25 +0000 (17:03 +0900)]
IndexDiffTest: Open Git instances in try-with-resources

Change-Id: I7fa2d16561982ddfde053f2fe78135c114b66b1d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoManifestParserTest: Don't use deprecated StringBufferInputStream 84/66584/1
David Pursehouse [Mon, 15 Feb 2016 07:52:40 +0000 (16:52 +0900)]
ManifestParserTest: Don't use deprecated StringBufferInputStream

Replace it with ByteArrayInputStream as suggested in [1].

[1] http://stackoverflow.com/a/2219543/381622

Change-Id: I5ca8d721a756a82ea5f5687a20555303eb1dfc18
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoInMemoryRepository: Remove unused RevWalk from batch method signature 83/66583/1
David Pursehouse [Mon, 15 Feb 2016 05:57:39 +0000 (14:57 +0900)]
InMemoryRepository: Remove unused RevWalk from batch method signature

The RevWalk given in the arguments is not used. According to the
comment at the top of the method, a new RevWalk is intentionally
used in the implementation.

Remove the unused argument.

Change-Id: Iec81a1341d5bf377801475845b96a465753096ef
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoIndexModificationTimesTest: Open Git instances in try-with-resource 82/66582/1
David Pursehouse [Mon, 15 Feb 2016 05:51:42 +0000 (14:51 +0900)]
IndexModificationTimesTest: Open Git instances in try-with-resource

Change-Id: If52c071b71f5df822b1ac276a6f665515f6c9d00
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoInterIndexDiffFilterTest: Open TreeWalk in try-with-resource 81/66581/1
David Pursehouse [Mon, 15 Feb 2016 05:49:58 +0000 (14:49 +0900)]
InterIndexDiffFilterTest: Open TreeWalk in try-with-resource

Change-Id: Ie0046771b1ab1c9784d9a3bb597a9d76c6c3017d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoLockFileTest: Open Git instance in try-with-resource 80/66580/1
David Pursehouse [Mon, 15 Feb 2016 05:48:02 +0000 (14:48 +0900)]
LockFileTest: Open Git instance in try-with-resource

Change-Id: Ie2b0e55e606f50c46e21227f23de74dbea8388e5
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoMerge branch 'stable-4.1' into stable-4.2 76/66576/1
David Pursehouse [Mon, 15 Feb 2016 01:25:25 +0000 (10:25 +0900)]
Merge branch 'stable-4.1' into stable-4.2

* stable-4.1:
  JGit v4.1.2.201602141800-r

Change-Id: I4156fd539da989c989aabce68d20dd9f8b5ad47c
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoJGit v4.1.2.201602141800-r 74/66574/1 v4.1.2.201602141800-r
Matthias Sohn [Sun, 14 Feb 2016 22:58:51 +0000 (23:58 +0100)]
JGit v4.1.2.201602141800-r

Change-Id: If0721109f389835a3a00b1a97559fd8f8c156556
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoBuck: Simplify root build file 62/66562/1
David Ostrovsky [Sun, 14 Feb 2016 10:36:25 +0000 (11:36 +0100)]
Buck: Simplify root build file

Remove all proxy rules, that were introduced to allow to build Gerrit
with hijacked JGit cell. New approach suggested in: [1], that emulates
real JGit project structure in its own cell, makes them unnecessary.

Add :all rule, that build all artifacts and packages them in zip file.
Add shell binary :jgit_bin rule, that allows to execute JGit binary
from with buck run command, e.g.:

  $ buck run jgit_bin status
  $ buck run jgit_bin -- --version

* [1] https://gerrit-review.googlesource.com/74859

Change-Id: Idf9ecb783cbd2b9984d4118047968f1f5204d642
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
8 years agoAdd Buck build aliases 13/66513/1
Saša Živkov [Fri, 12 Feb 2016 16:09:31 +0000 (17:09 +0100)]
Add Buck build aliases

Change-Id: I6aa2a8f094d36ef04dd12c81dfba8328e4a3bee9

8 years agoUpdate Buck version to the same version used in Gerrit master 12/66512/1
Saša Živkov [Fri, 12 Feb 2016 16:06:14 +0000 (17:06 +0100)]
Update Buck version to the same version used in Gerrit master

Change-Id: I3de69bfe2afc5c58aef704b72d6531aea826e179