* 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>
The Branch class has a member named 'branch', which was being
hidden by the local variable of the same name used in a for-loop.
Change-Id: I334092010a9c80686fb79713852d4bfa166ce12f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.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>
Repo manifest file allows revision attribute in <remote> tag. This change
teaches JGit to read that information.
Change-Id: I1c878a2505b9d09fa09fbd404a119b71f2fb8fdb
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* 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>
* 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
Replace with calls to WindowCacheConfig.install() as mentioned in
WindowCache.reconfigure's deprecation notice.
Change-Id: Ifdb33501a2209239029c815b1e4e844ea5b56075
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
The ObjectInserter.Formatter instance is only used to call idFor.
Factor out a utility method to do that.
Change-Id: I4ef823110c2152ac7905681df3217eb8001f5bd9
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Use try-with-resource to create instances of FileRepository and
FileWriter.
"resource" and "unused" warnings no longer occur, so remove the
suppression annotations.
Change-Id: I3ad58d4cc2d4c019cd8edda7cb401e9d9f3fb790
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
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>
The bundle org.eclipse.jgit.java7 was deleted in 4.0
Change-Id: I57dbc0b18eaf164c8f53cc2b776ecb80481a993d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
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>
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>
2262a794b4 removed throws CorruptObjectException, but was not
compiled under Eclipse and did not see errors generated by Eclipse.
Maven build silently ignored the unnecessary code.
Change-Id: I6e9014adcc604588e10e5963d13d0c6ef0e1c617
* 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>
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>
Git, ByteArrayOutputStream, and DiffFormatter are auto-closeable and
should be managed in try-with-resource.
Change-Id: I83395116acb4b4f7cd4300fd69564355bc07e4bb
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Use JUnit's assumeFalse method to cause the test to skip when
run on Windows.
Change-Id: I3f59440cfe62c37c127e381052b60471fbe8ec5e
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>