]> source.dussan.org Git - jgit.git/log
jgit.git
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 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

8 years agoFix buck classpath for tests 11/66511/1
Saša Živkov [Fri, 12 Feb 2016 16:01:09 +0000 (17:01 +0100)]
Fix buck classpath for tests

Change-Id: Idd2c22bbd2c81311c87a205fe707770300ec8f0c

8 years agoMerge branch 'stable-4.2' 77/66477/1
Matthias Sohn [Fri, 12 Feb 2016 10:15:19 +0000 (11:15 +0100)]
Merge branch 'stable-4.2'

* stable-4.2:
  NoteMapTest: Open TreeWalk instances in try-with-resource
  ObjectDirectoryTest: Fix warnings about variable hiding
  PackWriterTest: Open RevWalk in try-with-resource
  PatchIdDiffFormatterTest: Open Git and PatchIdDiffFormatter in try-with-resource
  PathSuffixFilterTest: Open TreeWalk in try-with-resource
  PostOrderTreeWalkTest: Open TreeWalk in try-with-resource
  PullCommandWithRebaseTest: Open RevWalk in try-with-resource
  PushCommandTest: Open Git instances in try-with-resource
  RacyGitTests: Open NameConflictTreeWalk in try-with-resource
  RecursiveMergerTest: Open TreeWalk and BufferedReader in try-with-resource
  ReflogConfigTest: refactor commit method to avoid variable hiding
  Update .mailmap
  RefDirectoryTest: Fix warning about member variable hiding
  ReflogResolveTest: Open Git instances in try-with-resource
  ReflogTest: Open Git instances in try-with-resource
  RepoCommandTest: Open Git instances in try-with-resource

Change-Id: I7964b699396629e31a9cc5600aedcf4be4e659a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMergeCommandTest: Use JUnit's assume to check preconditions 64/66464/1
David Pursehouse [Fri, 12 Feb 2016 05:41:44 +0000 (14:41 +0900)]
MergeCommandTest: Use JUnit's assume to check preconditions

Using the assume method, instead of just returning, will cause the
test to be marked as skipped rather than passed on systems where
the precondition is not satisfied.

Change-Id: I13672371f6cd3c481a0a6247e0eaed3aac6d766e
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoMergeCommandTest: Open Git instances in try-with-resource 63/66463/1
David Pursehouse [Fri, 12 Feb 2016 05:39:08 +0000 (14:39 +0900)]
MergeCommandTest: Open Git instances in try-with-resource

Change-Id: I95074358cec6fef6b5ced7bb7b117c33fee08a7a
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoNoteMapTest: Open TreeWalk instances in try-with-resource 62/66462/1
David Pursehouse [Fri, 12 Feb 2016 05:12:25 +0000 (14:12 +0900)]
NoteMapTest: Open TreeWalk instances in try-with-resource

Change-Id: I70da0140fe087e7e69c28e9ddd125495d916ec1b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoObjectDirectoryTest: Fix warnings about variable hiding 61/66461/1
David Pursehouse [Fri, 12 Feb 2016 05:10:12 +0000 (14:10 +0900)]
ObjectDirectoryTest: Fix warnings about variable hiding

The variable and parameter named 'db' were hiding class members
with the same name.

Change-Id: I27017afdc5f49c38c6f5be494e7a21239ea601a7
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoPackWriterTest: Open RevWalk in try-with-resource 60/66460/1
David Pursehouse [Fri, 12 Feb 2016 05:09:02 +0000 (14:09 +0900)]
PackWriterTest: Open RevWalk in try-with-resource

Change-Id: Ic8ed941d096718e81c7ffeb166bcf7faaa2ff57d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoPatchIdDiffFormatterTest: Open Git and PatchIdDiffFormatter in try-with-resource 59/66459/1
David Pursehouse [Fri, 12 Feb 2016 05:07:24 +0000 (14:07 +0900)]
PatchIdDiffFormatterTest: Open Git and PatchIdDiffFormatter in try-with-resource

Change-Id: I39e898e52c3d9dffaba9dabf11c085503fbc1acf
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoPathSuffixFilterTest: Open TreeWalk in try-with-resource 58/66458/1
David Pursehouse [Fri, 12 Feb 2016 05:02:49 +0000 (14:02 +0900)]
PathSuffixFilterTest: Open TreeWalk in try-with-resource

Change-Id: If0ee71f09a5464e27f0496dac364f8f9bb015eb6
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoPostOrderTreeWalkTest: Open TreeWalk in try-with-resource 57/66457/1
David Pursehouse [Fri, 12 Feb 2016 05:01:30 +0000 (14:01 +0900)]
PostOrderTreeWalkTest: Open TreeWalk in try-with-resource

Also remove unnecessary nesting in test methods.

Change-Id: Id59f8403c0a7b38ebb6b3a24814257cd59ea575d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoPullCommandWithRebaseTest: Open RevWalk in try-with-resource 56/66456/1
David Pursehouse [Fri, 12 Feb 2016 04:57:34 +0000 (13:57 +0900)]
PullCommandWithRebaseTest: Open RevWalk in try-with-resource

Change-Id: I16f4d219e8b103d30149b2a94d3484424f3de84b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoPushCommandTest: Open Git instances in try-with-resource 55/66455/1
David Pursehouse [Fri, 12 Feb 2016 04:55:40 +0000 (13:55 +0900)]
PushCommandTest: Open Git instances in try-with-resource

Change-Id: I3a8e28a4097e868a34ee1b23256c7f28d570cd75
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRacyGitTests: Open NameConflictTreeWalk in try-with-resource 54/66454/1
David Pursehouse [Fri, 12 Feb 2016 04:50:54 +0000 (13:50 +0900)]
RacyGitTests: Open NameConflictTreeWalk in try-with-resource

Change-Id: Ic17b05fd7d056761b352168de97efb607a289276
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRecursiveMergerTest: Open TreeWalk and BufferedReader in try-with-resource 53/66453/1
David Pursehouse [Fri, 12 Feb 2016 04:48:54 +0000 (13:48 +0900)]
RecursiveMergerTest: Open TreeWalk and BufferedReader in try-with-resource

Change-Id: I381d535eb4ed7535ba8541c5320f81ce11d5b173
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoReflogConfigTest: refactor commit method to avoid variable hiding 52/66452/1
David Pursehouse [Fri, 12 Feb 2016 04:43:56 +0000 (13:43 +0900)]
ReflogConfigTest: refactor commit method to avoid variable hiding

The author and committer parameters were hiding class members of
the same name.

Since the passed in PersonIdent instances were being created from
the class members anyway, remove the parameters and instead create
the PersonIdent instances inline in the method.

Change-Id: I66b057df388835d57f332fdcbadb8a9f4e1094a4
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoUpdate .mailmap 51/66451/1
David Pursehouse [Fri, 12 Feb 2016 03:39:06 +0000 (12:39 +0900)]
Update .mailmap

- List names alphabetically by Firstname Surname
- Replace tabs with spaces
- Add missing name

Change-Id: Ib320dad316e0f6e3e95363c4d6a64744032db857
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRefDirectoryTest: Fix warning about member variable hiding 50/66450/1
David Pursehouse [Fri, 12 Feb 2016 03:30:46 +0000 (12:30 +0900)]
RefDirectoryTest: Fix warning about member variable hiding

The parameter name 'totalWork' was hiding a class member variable
of the same name.

Change-Id: I646525e82900e23ffabfc756bcf5052ef873656a
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoReflogResolveTest: Open Git instances in try-with-resource 49/66449/1
David Pursehouse [Fri, 12 Feb 2016 03:29:44 +0000 (12:29 +0900)]
ReflogResolveTest: Open Git instances in try-with-resource

Change-Id: I11ee38bfcf4951bf05a1632df08b1d074d38338b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoReflogTest: Open Git instances in try-with-resource 48/66448/1
David Pursehouse [Fri, 12 Feb 2016 03:26:58 +0000 (12:26 +0900)]
ReflogTest: Open Git instances in try-with-resource

Change-Id: I950b6f16148cfe11de729b04904f88d6e4c28b9a
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRepoCommandTest: Open Git instances in try-with-resource 47/66447/1
David Pursehouse [Fri, 12 Feb 2016 03:25:20 +0000 (12:25 +0900)]
RepoCommandTest: Open Git instances in try-with-resource

Change-Id: I171e84eeb7862e74761ba6c961f14c86beaba9e7
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoFix packaging of lfs bundles 44/66444/2
Matthias Sohn [Fri, 12 Feb 2016 01:06:04 +0000 (02:06 +0100)]
Fix packaging of lfs bundles

- pgm feature needs to include the lfs feature
- add the lfs feature to the jgit p2 repository

Change-Id: I6781d4e9d131b373c9f191d785495e88b906c671
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoAdd Attribute Macro Expansion 17/60617/11
Ivan Motsch [Tue, 17 Nov 2015 15:04:01 +0000 (16:04 +0100)]
Add Attribute Macro Expansion

Attributes MacroExpander implements macros used in git attributes. This
is implemented inside the TreeWalk using a lazy created MacroExpander.
In addition, the macro expander caches the global and info attributes
node in order to provide fast merge of attributes.

Change-Id: I2e69c9fc84e9d7fb8df0a05817d688fc456d8f00
Signed-off-by: Ivan Motsch <ivan.motsch@bsiag.com>
8 years agoMerge branch 'stable-4.2' 57/66257/1
Matthias Sohn [Tue, 9 Feb 2016 23:50:41 +0000 (00:50 +0100)]
Merge branch 'stable-4.2'

* stable-4.2:
  RepoProject: Fix warnings about variable hiding
  RepoTest: Open Git in try-with-resources
  RepositoryResolveTest: Open Git in try-with-resource
  RepositoryTestCase: Open autocloseable types in try-with-resource
  ResetCommandTest: Use Git member in testHardResetAfterSquashMerge
  ResolveMergerTest: Open Git in try-with-resource
  RevCommitListTest: Open Git and RevWalk in try-with-resource
  RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource
  RevObjectTest: Open RevWalk in try-with-resource
  RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource
  RevertCommandTest: Open Git in try-with-resource
  SquashMessageFormatterTest: Open git in try-with-resource
  StatusCommandTest: Open Git in try-with-resource
  SubmoduleAddTest: Open Git in try-with-resource
  SymlinksTest: Open git and TreeWalk in try-with-resource
  T0003_BasicTest: Open autocloseable types in try-with-resource
  TextHashFunctions: Fix warnings about variable hiding
  TreeFilterTest: Open TreeWalk in try-with-resource
  TreeWalkJava7Test: Open TreeWalk in try-with-resource
  Fix diff for added and removed submodule

Change-Id: If3ecc63f6dfac55474d3c1dd2f4105371f3d24fb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoMerge branch 'stable-4.1' into stable-4.2 56/66256/1
Matthias Sohn [Tue, 9 Feb 2016 23:44:58 +0000 (00:44 +0100)]
Merge branch 'stable-4.1' into stable-4.2

* stable-4.1:
  Fix diff for added and removed submodule

Change-Id: I37dd71ed19b06e9bbcffe37370081ab875c6d8d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoRepoProject: Fix warnings about variable hiding 89/65989/1
David Pursehouse [Fri, 5 Feb 2016 09:22:58 +0000 (18:22 +0900)]
RepoProject: Fix warnings about variable hiding

Method parameter names were hiding class members of the same
name.

Change-Id: I182f2715894ac4259b09a371cb4e0eb24f52518a
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRepoTest: Open Git in try-with-resources 84/65984/1
David Pursehouse [Fri, 5 Feb 2016 09:17:02 +0000 (18:17 +0900)]
RepoTest: Open Git in try-with-resources

Allocate a new Git for each part of the test, rather than
reassigning to the same variable.

Change-Id: Ic83778bbff0b2f57d37b95aef70324859d42cd58
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRepositoryResolveTest: Open Git in try-with-resource 81/65981/1
David Pursehouse [Fri, 5 Feb 2016 09:14:26 +0000 (18:14 +0900)]
RepositoryResolveTest: Open Git in try-with-resource

Change-Id: Ibb612f3d8fd0f9913291430474311d9da62f4e6f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRepositoryTestCase: Open autocloseable types in try-with-resource 79/65979/1
David Pursehouse [Fri, 5 Feb 2016 09:12:05 +0000 (18:12 +0900)]
RepositoryTestCase: Open autocloseable types in try-with-resource

ObjectInserter.Formatter and Git are autocloseable and can be
opened in try-with-resource to prevent a resource leak warning.

Change-Id: I48c4001aaa7d9c1e36369e9799bfbb7c3bb46d8b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoResetCommandTest: Use Git member in testHardResetAfterSquashMerge 77/65977/1
David Pursehouse [Fri, 5 Feb 2016 08:36:05 +0000 (17:36 +0900)]
ResetCommandTest: Use Git member in testHardResetAfterSquashMerge

Use the class member instance of the Git rather than creating
a new one in the test. This makes it consistent with the other
tests in the module.

Change-Id: Ibe822ded76a80b94922e92bbc6f5d90bcc52f8a3
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoResolveMergerTest: Open Git in try-with-resource 76/65976/1
David Pursehouse [Fri, 5 Feb 2016 08:31:11 +0000 (17:31 +0900)]
ResolveMergerTest: Open Git in try-with-resource

Change-Id: Ic378ec25c4a3ea4354ee643029f87e46b6449ed4
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRevCommitListTest: Open Git and RevWalk in try-with-resource 75/65975/1
David Pursehouse [Fri, 5 Feb 2016 08:26:03 +0000 (17:26 +0900)]
RevCommitListTest: Open Git and RevWalk in try-with-resource

Change-Id: I4ba273a364a12f82a3b3b06ba050bc633411daf6
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource 74/65974/1
David Pursehouse [Fri, 5 Feb 2016 08:20:51 +0000 (17:20 +0900)]
RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource

Change-Id: Iaa87c51bc19b4fa832393c11db20b69865d30d48
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRevObjectTest: Open RevWalk in try-with-resource 73/65973/1
David Pursehouse [Fri, 5 Feb 2016 08:17:12 +0000 (17:17 +0900)]
RevObjectTest: Open RevWalk in try-with-resource

Change-Id: I19bcbb2f12036c5043436f3d544ccefbb7385b8d
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRevTagParseTest: Open ObjectInserter.Formatter in try-with-resource 72/65972/1
David Pursehouse [Fri, 5 Feb 2016 08:15:19 +0000 (17:15 +0900)]
RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource

Change-Id: I2341977223be1dc5252492f4775626122f56496b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoRevertCommandTest: Open Git in try-with-resource 71/65971/1
David Pursehouse [Fri, 5 Feb 2016 08:12:57 +0000 (17:12 +0900)]
RevertCommandTest: Open Git in try-with-resource

Change-Id: I659adbb0a6f741c4c6f615c8a24b4603c3f6681e
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoSquashMessageFormatterTest: Open git in try-with-resource 70/65970/1
David Pursehouse [Fri, 5 Feb 2016 08:05:05 +0000 (17:05 +0900)]
SquashMessageFormatterTest: Open git in try-with-resource

Change-Id: Ife94d1f0279ed3671a9bca79fb26c0403549fa17
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoStatusCommandTest: Open Git in try-with-resource 69/65969/1
David Pursehouse [Fri, 5 Feb 2016 08:03:25 +0000 (17:03 +0900)]
StatusCommandTest: Open Git in try-with-resource

Change-Id: Id13ad9fa3157d0479da12fb8184437be3ca8c948
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoSubmoduleAddTest: Open Git in try-with-resource 64/65964/1
David Pursehouse [Fri, 5 Feb 2016 05:11:54 +0000 (14:11 +0900)]
SubmoduleAddTest: Open Git in try-with-resource

Change-Id: I1276ce206e891729adfa681e00952ca0ba6ffc53
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoSymlinksTest: Open git and TreeWalk in try-with-resource 63/65963/1
David Pursehouse [Fri, 5 Feb 2016 05:05:22 +0000 (14:05 +0900)]
SymlinksTest: Open git and TreeWalk in try-with-resource

Change-Id: I0fd1933e843375029fa795447b688f23a893f84b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoT0003_BasicTest: Open autocloseable types in try-with-resource 62/65962/1
David Pursehouse [Fri, 5 Feb 2016 02:51:27 +0000 (11:51 +0900)]
T0003_BasicTest: Open autocloseable types in try-with-resource

FileRepository and ObjectInserter.Formatter are autocloseable, so
use try-with-resource for these.

Remove suppression of unused variable warning that is no longer
necessary.

Change-Id: I270829f0a4030083c9599eb5785b0145dc590ed8
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoTextHashFunctions: Fix warnings about variable hiding 61/65961/1
David Pursehouse [Fri, 5 Feb 2016 02:46:45 +0000 (11:46 +0900)]
TextHashFunctions: Fix warnings about variable hiding

The local variables/arguments named 'db' were hiding the member
variable of the same name in the superclass TextBuiltin.

Change-Id: Ic49dcb7cc2a1b3fb46ad78450042c8c8fb464a80
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoTreeFilterTest: Open TreeWalk in try-with-resource 60/65960/1
David Pursehouse [Fri, 5 Feb 2016 02:44:12 +0000 (11:44 +0900)]
TreeFilterTest: Open TreeWalk in try-with-resource

Change-Id: If100a66e544926bcffe9a9a0b31bfd4806902864
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoTreeWalkJava7Test: Open TreeWalk in try-with-resource 59/65959/1
David Pursehouse [Fri, 5 Feb 2016 02:42:44 +0000 (11:42 +0900)]
TreeWalkJava7Test: Open TreeWalk in try-with-resource

Change-Id: I99a483c482b5395653b0d57b368ec1b5fdba450c
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
8 years agoAdd support for HEAD requests to HttpClientConnection 71/65771/2
Matthias Sohn [Wed, 3 Feb 2016 10:34:35 +0000 (11:34 +0100)]
Add support for HEAD requests to HttpClientConnection

Change-Id: I501f37e06b686a3a0bb5fd857dd72e424da91d3e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoAllow to reuse disableSslVerify method, move it to HttpSupport 77/64677/5
Saša Živkov [Tue, 19 Jan 2016 16:52:19 +0000 (17:52 +0100)]
Allow to reuse disableSslVerify method, move it to HttpSupport

The disableSslVerify method will be used in the follow up change.

Change-Id: Ie00b5e14244a9a036cbdef94768007f1c25aa8d3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
8 years agoSupport LFS protocol and a file system based LFS storage 77/52177/16
Matthias Sohn [Tue, 22 Dec 2015 15:11:43 +0000 (16:11 +0100)]
Support LFS protocol and a file system based LFS storage

Implement LfsProtocolServlet handling the "Git LFS v1 Batch API"
protocol [1]. Add a simple file system based LFS content store and the
debug-lfs-store command to simplify testing.

Introduce a LargeFileRepository interface to enable additional storage
implementation while reusing the same protocol implementation.

At the client side we have to configure the lfs.url, specify that
we use the batch API and we don't use authentication:

  [lfs]
  url = http://host:port/lfs
  batch = true
  [lfs "http://host:port/lfs"]
  access = none

the git-lfs client appends the "objects/batch" to the lfs.url.

Hard code an Authorization header in the FileLfsRepository.getAction
because then git-lfs client will skip asking for credentials. It will
just forward the Authorization header from the response to the
download/upload request.

The FileLfsServlet supports file content storage for "Large File
Storage" (LFS) server as defined by the Github LFS API [2].

- upload and download of large files is probably network bound hence use
  an asynchronous servlet for good scalability
- simple object storage in file system with 2 level fan-out
- use LockFile to protect writing large objects against multiple
  concurrent uploads of the same object
- to prevent corrupt uploads the uploaded file is rejected if its hash
  doesn't match id given in URL

The debug-lfs-store command is used to run the LfsProtocolServlet and,
optionally, the FileLfsServlet which makes it easier to setup a
local test server.

[1]
https://github.com/github/git-lfs/blob/master/docs/api/http-v1-batch.md
[2] https://github.com/github/git-lfs/tree/master/docs/api

Bug: 472961
Change-Id: I7378da5575159d2195138d799704880c5c82d5f3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
8 years agoAdd com.google.gson 2.2.4.v201311231704 to target platform 54/52354/9
Matthias Sohn [Fri, 17 Jul 2015 21:57:46 +0000 (23:57 +0200)]
Add com.google.gson 2.2.4.v201311231704 to target platform

We will use gson to implement the LFS REST API.

CQ: 9966
Change-Id: I7feb6b2b8f7b736888370aad94e4c436ae6014bb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>