summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Implement SHA-256 abstractionMatthias Sohn2016-02-041-1/+12
| | | | | | | | | | | | 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>
* Merge branch 'stable-4.2'Matthias Sohn2016-02-033-231/+238
|\ | | | | | | | | | | | | | | | | | | | | | | * 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>
| * DirCacheCheckoutTest: Open Git and TreeWalk in try-with-resourceDavid Pursehouse2016-02-021-106/+109
| | | | | | | | | | Change-Id: Icc8eda841e6a437e1acf3438525014e7c46d5eb2 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * ApplyCommandTest: Open Git in try-with-resourceDavid Pursehouse2016-02-021-16/+17
| | | | | | | | | | | | | | Also, add missing braces around if-block. Change-Id: I9390b2c7d5c4507923b6f06271a070dc868534e5 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * PackFileTest: Open ObjectInserter.Formatter in try-with-resourceDavid Pursehouse2016-02-021-109/+112
| | | | | | | | | | Change-Id: I9c56b5efdb9c13b929073a786092a707fca21281 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
* | Merge branch 'stable-4.2'David Pursehouse2016-02-0110-1169/+1223
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * FileTreeIteratorTest: Open Git and RevWalk in try-with-resourceDavid Pursehouse2016-01-261-195/+204
| | | | | | | | | | Change-Id: I6e68c4b028e0aa01964eace10307372060371df7 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * RebaseCommandTest: Open RevWalk in try-with-resourceDavid Pursehouse2016-01-251-178/+200
| | | | | | | | | | Change-Id: If7b7a90171d1349d634a84f135471ebac29e3210 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * PullCommandTest: Open RevWalk in try-with-resourceDavid Pursehouse2016-01-251-15/+18
| | | | | | | | | | Change-Id: I676cd7ef4bb29f980a313acd77506dd070e6c98f Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * BlameGeneratorTest: Create Git instances in try-with-resourceDavid Pursehouse2016-01-251-118/+119
| | | | | | | | | | Change-Id: I2dc4191603fbd6c3214763b869882c51b0e53284 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * Remove unnecessary suppression of deprecation warnings in testsDavid Pursehouse2016-01-253-3/+0
| | | | | | | | | | Change-Id: I722f8c2e80129e0129349b55a53b29626e2af21c Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * DiffEntryTest: Open Git and TreeWalk in try-with-resourceDavid Pursehouse2016-01-251-261/+272
| | | | | | | | | | Change-Id: If4a49268b9b7ec3a44ed1508ed78db365b0c9e5b Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * DiffCommandTest: Open Git and RevWalk in try-with-resourceDavid Pursehouse2016-01-251-139/+144
| | | | | | | | | | Change-Id: I966f7e5053651661abc7de63c968e1f5bf2de464 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * CommitCommandTest: Open Git and TreeWalk in try-with-resourceDavid Pursehouse2016-01-251-260/+266
| | | | | | | | | | Change-Id: I65a6fd7028e209c300d992c2756100c09ab4dc19 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
* | [gitrepo] Support revision in remote tag.Yuxuan 'fishy' Wang2016-01-271-0/+53
| | | | | | | | | | | | | | | | 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>
* | Merge branch 'stable-4.2'Matthias Sohn2016-01-245-73/+82
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * Merge changes Ifdb33501,Idc7b7bbd,Ia3db8696,I4ef82311,I3ad58d4c, ... into ↵Matthias Sohn2016-01-235-73/+82
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * ConcurrentRepackTest: Don't use deprecated WindowCache.reconfigureDavid Pursehouse2016-01-221-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * ConcurrentRepackTest: Open RevWalk in try-with-resourceDavid Pursehouse2016-01-221-3/+6
| | | | | | | | | | | | | | | Change-Id: Idc7b7bbdc1df05372b873cbe4c495474f3ffd64b Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| | * CommitOnlyTest: Open RevWalk in try-with-resourceDavid Pursehouse2016-01-221-4/+6
| | | | | | | | | | | | | | | Change-Id: Ia3db8696f66f8d294e1d443fb54e716d26d517b1 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| | * UnpackedObjectTest: Create ObjectInserter.Formatter in try-with-resourceDavid Pursehouse2016-01-221-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * FileRepositoryBuilderTest: Use try-with-resource for auto-closeablesDavid Pursehouse2016-01-221-48/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * RepositorySetupWorkDirTest: Fix "resource leak" warningsDavid Pursehouse2016-01-221-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Prepare 4.2.1-SNAPSHOT buildsMatthias Sohn2016-01-222-42/+42
| |/ | | | | | | | | Change-Id: Ic9eac53b10ac97b2038b334d388ae3d21393f993 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.2.0.201601211800-rv4.2.0.201601211800-rMatthias Sohn2016-01-212-2/+2
| | | | | | | | | | Change-Id: I89f33b0da81ff499315baa5311f95f31724fa510 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Fix unused throws CorruptObjectException from addTreeShawn Pearce2016-01-212-4/+2
| | | | | | | | | | | | | | | | 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. Change-Id: I6e9014adcc604588e10e5963d13d0c6ef0e1c617
| * Merge branch 'master' into stable-4.2Matthias Sohn2016-01-2132-1531/+2715
| |\ | | | | | | | | | Change-Id: Ieec4f51aedadf5734ae0e3f4e8713248a3c4fc52 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Prepare 4.3.0-SNAPSHOT buildsMatthias Sohn2016-01-212-42/+42
| | | | | | | | | | | | | | | Change-Id: Idcf0479529693b023042becd96698f9afd344bd4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge branch 'stable-4.2'Matthias Sohn2016-01-2110-1370/+1440
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * | BundleWriterTest: Open RevWalk in try-with-resourceDavid Pursehouse2016-01-211-18/+20
| | | | | | | | | | | | | | | Change-Id: Ie25770a73b19d6522bad9fdc0966f48370f96265 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | DiffFormatterTest: Remove accidentally added trailing whitespaceDavid Pursehouse2016-01-211-2/+2
| | | | | | | | | | | | | | | Change-Id: Ia7a3b05b79c3a5530a4445e6e48ceae445425224 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | CherryPickCommandTest: Create Git instances in try-with-resourceDavid Pursehouse2016-01-211-191/+197
| | | | | | | | | | | | | | | Change-Id: I9d49258bdf12f3221013c37cfb8a21ea27f28860 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | DiffFormatterTest: Create auto-closeable instances in try-with-resourceDavid Pursehouse2016-01-211-78/+82
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | CommitAndLogCommandTest: Use assumeFalse to skip test on WindowsDavid Pursehouse2016-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | CommitAndLogCommandTest: Create Git instances in try-with-resourceDavid Pursehouse2016-01-211-250/+256
| | | | | | | | | | | | | | | Change-Id: Id06417f1d3914cd3addacdbe9b5801a06cc3955f Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | AddCommandTest: Create Git instances in try-with-resourceDavid Pursehouse2016-01-211-306/+327
| | | | | | | | | | | | | | | Change-Id: Idf42f03099eeb9975fef9492ea8a75776afc2a3c Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | ArchiveCommandTest: Create Git instances in try-with-resourceDavid Pursehouse2016-01-211-85/+89
| | | | | | | | | | | | | | | Change-Id: Icbfd92395db85818736142fd3fb3432385e89ca9 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | TagCommandTest: Instantiate Git and RevWalk objects in try-with-resourceDavid Pursehouse2016-01-201-101/+115
| | | | | | | | | | | | | | | Change-Id: I08959650e2970e964bc864dc6d120d7bddfd8232 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | BlameCommandTest: Instantiate Git objects in try-with-resourceDavid Pursehouse2016-01-201-303/+305
| | | | | | | | | | | | | | | Change-Id: Icb9e6bb9ee99589fa2e0388c8b305a8a1f5954db Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | SideBandOutputStreamTest: Use try-with-resourceDavid Pursehouse2016-01-201-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out the creation of the SideBandOutputStream objects into a utility method that wraps it in a try-with-resource. Remove the "unused" suppression that is now unnecessary, and add declaration that the tests methods can throw Exception. Change-Id: Iff02e4e3532bd6ab6e423f197e70d44c4f328d0b Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * | FileTreeIteratorJava7Test: Create Git instances in try-with-resourceDavid Pursehouse2016-01-201-32/+38
| | | | | | | | | | | | | | | Change-Id: I493e90e8a0d96db5acc49759c8e138b0a8c7b099 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
* | | Fix unused throws CorruptObjectException from addTreeShawn Pearce2016-01-202-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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. Change-Id: I6e9014adcc604588e10e5963d13d0c6ef0e1c617
* | | Merge changes from topic 'reftree'Shawn Pearce2016-01-212-0/+159
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | * changes: debug-rebuild-ref-tree: Copy HEAD into RefTree debug-rebuild-ref-tree: Add --enable flag to turn the database on RefTreeDatabase: Allow ORIG_HEAD, etc. on non-bare repositories RefTreeDatabase: Expose bootstrap refs in getAdditionalRefs
| * | RefTreeDatabase: Allow ORIG_HEAD, etc. on non-bare repositoriesShawn Pearce2016-01-152-0/+148
| | | | | | | | | | | | | | | | | | | | | Store these in the bootstrap layer where they are using $GIT_DIR as the storage directory for any reference that does not contain '/'. Change-Id: I5595bf514e4475b7c7e799c2c79446597a3abb4a
| * | RefTreeDatabase: Expose bootstrap refs in getAdditionalRefsShawn Pearce2016-01-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By showing the bootstrap layer in getAdditionalRefs() garbage collector code can be more RefDatabase agnostic and not care about the special case of RefTree and RefTreeNames for the purposes of building up the roots to GC. Instead they can combine getRefs(ALL) and getAdditionalRefs() and have a clean set of roots. Change-Id: I665cd2456e9316640215b6a08bc728d1356f36d8
* | | Fix ResetCommand to return the resulting refChristian Halstrick2016-01-201-21/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | ResetCommand was not returning the updated ref as a result of the call() method. Since the ResetCommand is always updating the same ref (HEAD) this should always be the HEAD ref. Bug: 440750 Change-Id: I7974975c3ab05e68c208384e69cf0692ded6e8db Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Add option to allow empty commits to CommitCommandChristian Halstrick2016-01-201-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CommitCommand should allow to specify whether empty commits (commits having the same tree as the sole predecessor commit) are allowed or not. Similar to native git's "--allow-empty" flag. The defaults differ between JGit and native git even after this change. When not specifying paths then by default JGit allows to create empty commits while native git does not. It would be API breaking to change this now. Bug: 460301 Change-Id: I88feb0c3ffb2c686b1d0594e669729b065cda4cb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Remove declared IOException which is no longer thrown"Matthias Sohn2016-01-191-2/+1
|\ \ \
| * | | Remove declared IOException which is no longer thrownMatthias Sohn2016-01-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2ccea7f0 ChangeIdUtil.computeChangeId() doesn't throw IOException anymore. Change-Id: I0bf43f2346dadbbfe7e6cbcb38b5525456fbf686 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Merge branch 'stable-4.2'David Pursehouse2016-01-209-128/+119
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.2: CheckoutCommandTest: Create Git instances in try-with-resource BranchCommandTest: Create Git instances in try-with-resource CheckoutTest: Create Git instances in try-with-resource BranchTest: Create Git instances in try-with-resource URIishTest: Use @Test annotation's `expected` argument Suppress "The allocated object is never used" warning in tests Add $NON-NLS to suppress "Non-externalized string literal" warnings Don't use deprecated constructors of CmdLineException Prepare 4.2.0-SNAPSHOT builds Remove org.eclipse.jgit.updatesite project from tools/version.sh RevParse: Remove superfluous semicolon RefUpdateTest: Use try-with-resource for auto-closable types RefUpdateTest: Add null check to prevent potential NPE CommitCommand: Remove redundant null check JGit v4.2.0.201512141825-rc1 Change-Id: I2179859289b2f2e3d0b7c6d02ef7e7890c467f7b Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>