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>
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>
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>
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>
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:
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.
Matthias Sohn [Fri, 17 Jul 2015 14:22:56 +0000 (16:22 +0200)]
Implement SHA-256 abstraction
The Large File Storage extension specified by GitHub [1] uses SHA-256 to
compute the ID of large files stored by the extension. Hence implement a
SHA-256 abstraction similar to the SHA-1 abstraction used by JGit.
[1] https://git-lfs.github.com/
Bug: 470333
Change-Id: I3a95954543c8570d73929e55f4a884b55dbf1b7a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Hugo Arès [Thu, 4 Feb 2016 13:55:20 +0000 (08:55 -0500)]
Fix diff for added and removed submodule
Since If13f7b406, submodule difference are shown as a hunk. The issue
was that added and removed submodule were considered as Edit.REPLACE
instead of Edit.INSERT and Edit.DELETE in the DiffFormatter result.
Change-Id: I4330c2aa3f10e29d7d6b0b2e5286e59293a06239 Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
Matthias Sohn [Wed, 3 Feb 2016 09:30:38 +0000 (10:30 +0100)]
Merge branch 'stable-4.2'
* stable-4.2:
DirCacheCheckoutTest: Open Git and TreeWalk in try-with-resource
CommitCommand: Remove declaration of unthrown exception
Branch: Fix variable hiding warning
ApplyCommandTest: Open Git in try-with-resource
PackFileTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I8484b10fad5a4c35fcfaedc1cdf8ccf97471618e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* stable-4.2:
FileTreeIteratorTest: Open Git and RevWalk in try-with-resource
RebaseCommandTest: Open RevWalk in try-with-resource
PullCommandTest: Open RevWalk in try-with-resource
BlameGeneratorTest: Create Git instances in try-with-resource
Remove unnecessary suppression of deprecation warnings in tests
DiffEntryTest: Open Git and TreeWalk in try-with-resource
DiffCommandTest: Open Git and RevWalk in try-with-resource
CommitCommandTest: Open Git and TreeWalk in try-with-resource
Change-Id: Ic886ec9b1a4b3b46f9fa14188b4df832ce36cfa6 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Matthias Sohn [Sun, 24 Jan 2016 09:59:14 +0000 (10:59 +0100)]
Merge branch 'stable-4.2'
* stable-4.2:
ConcurrentRepackTest: Don't use deprecated WindowCache.reconfigure
ConcurrentRepackTest: Open RevWalk in try-with-resource
CommitOnlyTest: Open RevWalk in try-with-resource
UnpackedObjectTest: Create ObjectInserter.Formatter in try-with-resource
FileRepositoryBuilderTest: Use try-with-resource for auto-closeables
RepositorySetupWorkDirTest: Fix "resource leak" warnings
Remove java7 bundle from Maven central scripts
Prepare 4.2.1-SNAPSHOT builds
JGit v4.2.0.201601211800-r
Add progress monitor to Merger
Fix TransportException when reading bundle
Fix unused throws CorruptObjectException from addTree
Change-Id: I2325fb995561a6249b7b5e82fa413dfd34ef6007 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Matthias Sohn [Sun, 24 Jan 2016 01:11:04 +0000 (20:11 -0500)]
Merge changes Ifdb33501,Idc7b7bbd,Ia3db8696,I4ef82311,I3ad58d4c, ... into stable-4.2
* changes:
ConcurrentRepackTest: Don't use deprecated WindowCache.reconfigure
ConcurrentRepackTest: Open RevWalk in try-with-resource
CommitOnlyTest: Open RevWalk in try-with-resource
UnpackedObjectTest: Create ObjectInserter.Formatter in try-with-resource
FileRepositoryBuilderTest: Use try-with-resource for auto-closeables
RepositorySetupWorkDirTest: Fix "resource leak" warnings
Use FileRepositoryBuilder to create the Repository, except in cases
where the creation was already in a try-block. Convert those to use
a try-with-resource.
Change-Id: I7d7adeee81bda6e80d91a119c7d690de3d00dc2b Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Laurent Delaigue [Wed, 13 Jan 2016 15:56:00 +0000 (16:56 +0100)]
Add progress monitor to Merger
Monitoring progress of merges can be useful for users for large
repositories or complex merge processes that take some time.
This enables setting a monitor. Existing merge implementations in jgit
do not yet report progress if a monitor is set. This will be added in a
later change.
Change-Id: I17b978b3fc91750dd88649638b90a46820a0877c Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Chris Gavin [Wed, 6 Jan 2016 15:53:22 +0000 (15:53 +0000)]
Fix TransportException when reading bundle
When reading a bundle file, commit messages who's oneline format is
longer than 982 characters caused JGit to treat subsequent text in
the commit as a SHA, then throw a TransportException because it's
not a valid SHA.
Now the readLine method will read all the way to the end of the
line, not just the first 1024 characters of it.
Change-Id: If15b491aa9a1e4fd9b8bbed2dd9e6be47a64ccb7 Signed-off-by: Chris Gavin <chris@chrisgavin.me>
Shawn Pearce [Thu, 21 Jan 2016 06:08:23 +0000 (22:08 -0800)]
Fix unused throws CorruptObjectException from addTree
2262a794b48ea removed throws CorruptObjectException, but was not
compiled under Eclipse and did not see errors generated by Eclipse.
Maven build silently ignored the unnecessary code.
Matthias Sohn [Thu, 21 Jan 2016 13:04:39 +0000 (14:04 +0100)]
Merge branch 'stable-4.2'
* stable-4.2:
BundleWriterTest: Open RevWalk in try-with-resource
DiffFormatterTest: Remove accidentally added trailing whitespace
CherryPickCommandTest: Create Git instances in try-with-resource
DiffFormatterTest: Create auto-closeable instances in try-with-resource
ConfigTest: Create Git instance in try-with-resource
CommitAndLogCommandTest: Use assumeFalse to skip test on Windows
CommitAndLogCommandTest: Create Git instances in try-with-resource
AddCommandTest: Create Git instances in try-with-resource
ArchiveCommandTest: Create Git instances in try-with-resource
TagCommandTest: Instantiate Git and RevWalk objects in try-with-resource
BlameCommandTest: Instantiate Git objects in try-with-resource
SideBandOutputStreamTest: Use try-with-resource
FileTreeIteratorJava7Test: Create Git instances in try-with-resource
Change-Id: Ib572e98e6117b70442aee9cd7e7b8c3cf65562a7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Laurent Delaigue [Wed, 13 Jan 2016 15:56:00 +0000 (16:56 +0100)]
Add progress monitor to Merger
Monitoring progress of merges can be useful for users for large
repositories or complex merge processes that take some time.
This enables setting a monitor. Existing merge implementations in jgit
do not yet report progress if a monitor is set. This will be added in a
later change.
Change-Id: I17b978b3fc91750dd88649638b90a46820a0877c Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Chris Gavin [Wed, 6 Jan 2016 15:53:22 +0000 (15:53 +0000)]
Fix TransportException when reading bundle
When reading a bundle file, commit messages who's oneline format is
longer than 982 characters caused JGit to treat subsequent text in
the commit as a SHA, then throw a TransportException because it's
not a valid SHA.
Now the readLine method will read all the way to the end of the
line, not just the first 1024 characters of it.
Change-Id: If15b491aa9a1e4fd9b8bbed2dd9e6be47a64ccb7 Signed-off-by: Chris Gavin <chris@chrisgavin.me>
Shawn Pearce [Thu, 21 Jan 2016 06:08:23 +0000 (22:08 -0800)]
Fix unused throws CorruptObjectException from addTree
2262a794b48ea removed throws CorruptObjectException, but was not
compiled under Eclipse and did not see errors generated by Eclipse.
Maven build silently ignored the unnecessary code.