Commit Graph

4322 Commits

Author SHA1 Message Date
Matthias Sohn 536db18cc6 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>
2016-02-04 17:49:42 +01:00
Matthias Sohn 2de33d7678 Remove unused API problem filters
Change-Id: I8b1c99b108b4cea6356e0a62e6bfc0731df44cf5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-03 10:39:08 +01:00
Matthias Sohn b0facdc113 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>
2016-02-03 10:30:52 +01:00
David Pursehouse 06bf69d8ca DirCacheCheckoutTest: Open Git and TreeWalk in try-with-resource
Change-Id: Icc8eda841e6a437e1acf3438525014e7c46d5eb2
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:30:30 +09:00
David Pursehouse 521f513d6d CommitCommand: Remove declaration of unthrown exception
Change-Id: I1795b1e510ab170f062ee6c5988d7a7567abe260
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:27:47 +09:00
David Pursehouse 2fab7f20a7 Branch: Fix variable hiding warning
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>
2016-02-02 18:25:55 +09:00
David Pursehouse d4ddb6fc2b ApplyCommandTest: Open Git in try-with-resource
Also, add missing braces around if-block.

Change-Id: I9390b2c7d5c4507923b6f06271a070dc868534e5
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:22:32 +09:00
David Pursehouse 5c84145fd0 PackFileTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I9c56b5efdb9c13b929073a786092a707fca21281
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-02-02 18:20:38 +09:00
David Pursehouse 27a6a52654 Merge branch 'stable-4.2'
* 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>
2016-02-01 10:30:42 +09:00
Shawn Pearce 91c7907c74 Merge "Remove unused dependency to commons logging" 2016-01-31 13:33:31 -05:00
Matthias Sohn 9400d0cb17 Merge "Prevent ChainingCredentialsProvider from adding delegated providers twice" 2016-01-28 18:51:14 -05:00
Yuxuan 'fishy' Wang 7960fa8735 [gitrepo] Support revision in remote tag.
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>
2016-01-27 16:01:06 -08:00
Rüdiger Herrmann bd67084d2b Prevent ChainingCredentialsProvider from adding delegated providers twice
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Change-Id: Icc0907af4fe26877d066db3c813dba37213a3ccc
2016-01-26 18:55:39 +01:00
David Pursehouse bebd30f364 FileTreeIteratorTest: Open Git and RevWalk in try-with-resource
Change-Id: I6e68c4b028e0aa01964eace10307372060371df7
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-26 17:56:47 +09:00
David Pursehouse 92a8e0184c RebaseCommandTest: Open RevWalk in try-with-resource
Change-Id: If7b7a90171d1349d634a84f135471ebac29e3210
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 17:05:14 +09:00
David Pursehouse 7ccda5f63e PullCommandTest: Open RevWalk in try-with-resource
Change-Id: I676cd7ef4bb29f980a313acd77506dd070e6c98f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 15:23:06 +09:00
David Pursehouse e5cf4a89fd BlameGeneratorTest: Create Git instances in try-with-resource
Change-Id: I2dc4191603fbd6c3214763b869882c51b0e53284
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 15:20:24 +09:00
David Pursehouse 88d63ce174 Remove unnecessary suppression of deprecation warnings in tests
Change-Id: I722f8c2e80129e0129349b55a53b29626e2af21c
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 12:00:57 +09:00
David Pursehouse 4c128b0764 DiffEntryTest: Open Git and TreeWalk in try-with-resource
Change-Id: If4a49268b9b7ec3a44ed1508ed78db365b0c9e5b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 11:55:46 +09:00
David Pursehouse 6b66240311 DiffCommandTest: Open Git and RevWalk in try-with-resource
Change-Id: I966f7e5053651661abc7de63c968e1f5bf2de464
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 11:48:58 +09:00
David Pursehouse ff90192a05 CommitCommandTest: Open Git and TreeWalk in try-with-resource
Change-Id: I65a6fd7028e209c300d992c2756100c09ab4dc19
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-25 10:41:24 +09:00
Rüdiger Herrmann 3a4fd91928 Remove unused dependency to commons logging
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Change-Id: Ibbca0f7023350a5d424b6a5a84a5d11845a8ded7
2016-01-24 13:47:31 +01:00
Matthias Sohn 114ee5a613 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>
2016-01-24 10:59:24 +01:00
Matthias Sohn 281dcf8956 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
2016-01-23 20:11:04 -05:00
Matthias Sohn 27846d9e42 Compare API against 4.2.0
Change-Id: I08e2cf8f3fbb9e63f4a264daf8d9cc41dde55921
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-23 23:51:26 +01:00
Thomas Wolf 9441d61e37 Fix a @since tag
Ketch didn't make it into 4.2

Change-Id: Iab3ddfb926a2f8d31622e212c845c825369b09d5
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-01-23 23:51:14 +01:00
David Pursehouse 4319086892 ConcurrentRepackTest: Don't use deprecated WindowCache.reconfigure
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>
2016-01-22 15:03:33 +09:00
David Pursehouse 8bbd9077e4 ConcurrentRepackTest: Open RevWalk in try-with-resource
Change-Id: Idc7b7bbdc1df05372b873cbe4c495474f3ffd64b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 14:59:54 +09:00
David Pursehouse 625a21f5f4 CommitOnlyTest: Open RevWalk in try-with-resource
Change-Id: Ia3db8696f66f8d294e1d443fb54e716d26d517b1
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-22 14:57:21 +09:00
David Pursehouse 84ac3cc379 UnpackedObjectTest: Create ObjectInserter.Formatter in try-with-resource
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>
2016-01-22 14:51:59 +09:00
David Pursehouse 3ee9e2ac07 FileRepositoryBuilderTest: Use try-with-resource for auto-closeables
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>
2016-01-22 14:31:50 +09:00
David Pursehouse ddcbd22cd3 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>
2016-01-22 14:21:15 +09:00
Matthias Sohn 5da5eb4b69 Remove java7 bundle from Maven central scripts
The bundle org.eclipse.jgit.java7 was deleted in 4.0

Change-Id: I57dbc0b18eaf164c8f53cc2b776ecb80481a993d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-22 01:50:36 +01:00
Matthias Sohn fc4d117511 Prepare 4.2.1-SNAPSHOT builds
Change-Id: Ic9eac53b10ac97b2038b334d388ae3d21393f993
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-22 01:48:52 +01:00
Matthias Sohn 20c2079f70 JGit v4.2.0.201601211800-r
Change-Id: I89f33b0da81ff499315baa5311f95f31724fa510
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21 23:47:12 +01:00
Terry Parker f321741cff Merge "Remove unused variable from DfsBlockCache" 2016-01-21 16:21:15 -05:00
Terry Parker 4d178be021 Remove unused variable from DfsBlockCache
Change-Id: I8ea167e44e9ebcac7ca08920e806d8bcb8188bf0
Signed-off-by: Terry Parker <tparker@google.com>
2016-01-21 13:02:39 -08:00
Matthias Sohn b30917ce21 Prepare 4.3.0-SNAPSHOT builds
Change-Id: Idcf0479529693b023042becd96698f9afd344bd4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21 21:49:41 +01:00
Laurent Delaigue 4409751516 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>
2016-01-21 17:08:04 +01:00
Chris Gavin 82f47ace3d 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>
2016-01-21 17:07:57 +01:00
Shawn Pearce c221bd6c15 Fix unused throws CorruptObjectException from addTree
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
2016-01-21 17:07:50 +01:00
Matthias Sohn 4ec84fac86 Merge branch 'master' into stable-4.2
Change-Id: Ieec4f51aedadf5734ae0e3f4e8713248a3c4fc52
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21 17:07:31 +01:00
Matthias Sohn 34b4a564ea 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>
2016-01-21 14:04:39 +01:00
Laurent Delaigue 1e1fb9fc59 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>
2016-01-21 11:37:26 +01:00
David Pursehouse 7e8e4ec019 BundleWriterTest: Open RevWalk in try-with-resource
Change-Id: Ie25770a73b19d6522bad9fdc0966f48370f96265
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-21 19:13:23 +09:00
David Pursehouse 2a7b3ff00b DiffFormatterTest: Remove accidentally added trailing whitespace
Change-Id: Ia7a3b05b79c3a5530a4445e6e48ceae445425224
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-21 19:12:12 +09:00
David Pursehouse 776030f198 CherryPickCommandTest: Create Git instances in try-with-resource
Change-Id: I9d49258bdf12f3221013c37cfb8a21ea27f28860
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-21 18:07:54 +09:00
David Pursehouse 1257cfc262 DiffFormatterTest: Create auto-closeable instances in try-with-resource
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>
2016-01-21 17:01:25 +09:00
David Pursehouse 72c94465bc ConfigTest: Create Git instance in try-with-resource
Change-Id: Ie65c69e0f1aed95bcdf68ebd68d21b3e2590b41c
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
2016-01-21 15:31:56 +09:00
David Pursehouse ce1a3d7ef8 CommitAndLogCommandTest: Use assumeFalse to skip test on Windows
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>
2016-01-21 15:30:49 +09:00