summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test
Commit message (Collapse)AuthorAgeFilesLines
* Prepare 4.8.0-SNAPSHOT buildsMatthias Sohn2017-04-052-19/+19
| | | | | Change-Id: Ifea6750e79d417a8a2a891b3b5f96d68c7200011 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove Buck buildDavid Pursehouse2017-03-221-37/+0
| | | | | | Buck will be replaced with Bazel Change-Id: I3cf07d7aaaa2a58bac34e16c50af5416693254ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add remaining parts of the bazel buildDavid Ostrovsky2017-03-211-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bazel build for ui and junit.http, and the test packages. A number of different test labels are supported: api attributes dfs diff http lfs lfs-server nls notes pack patch pgm reftree revplot revwalk storage submodule symlinks transport treewalk util To run all tests: bazel test //... To run specific tests, using labels: bazel test --test_tag_filters=api,dfs,revplot,treewalk //... Change-Id: Ic41b05a79d855212e67b1b4707e9c6b4dc9ea70d Signed-off-by: David Ostrovsky <david@ostrovsky.org> Signed-off-by: Jonathan Nieder <jrn@google.com>
* Enable and fix warnings about redundant specification of type argumentsDavid Pursehouse2017-02-205-11/+11
| | | | | | | | | | Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Enable and fix 'Should be tagged with @Override' warningDavid Pursehouse2017-02-194-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Set missingOverrideAnnotation=warning in Eclipse compiler preferences which enables the warning: The method <method> of type <type> should be tagged with @Override since it actually overrides a superclass method Justification for this warning is described in: http://stackoverflow.com/a/94411/381622 Enabling this causes in excess of 1000 warnings across the entire code-base. They are very easy to fix automatically with Eclipse's "Quick Fix" tool. Fix all of them except 2 which cause compilation failure when the project is built with mvn; add TODO comments on those for further investigation. Change-Id: I5772061041fd361fe93137fd8b0ad356e748a29c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Prepare 4.7.0-SNAPSHOT buildsMatthias Sohn2016-12-272-19/+19
| | | | | Change-Id: I20754d13007e6591d36aae5766f3a9a82b24e120 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.6.1-SNAPSHOT buildsMatthias Sohn2016-12-242-19/+19
| | | | | Change-Id: I6b05a6f6c3f92365c272e1bdaf76093ca01f2d58 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.6.0.201612231935-rv4.6.0.201612231935-rMatthias Sohn2016-12-242-2/+2
| | | | | Change-Id: Iaa88fe1b195dfe6be99a7b4cb064684e75563715 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Organize importsDavid Pursehouse2016-11-143-6/+9
| | | | | Change-Id: I7c545d06b1bced678c020fab9af1382bc4416b6e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Preserve backslashes within double quotes in CLIGitCommand::split()Rüdiger Herrmann2016-10-232-1/+3
| | | | Change-Id: Ia6a56512baa6a0f27e2eef1b19ebb60291ba377f Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
* Checkout: Add the ability to checkout all paths.Ned Twigg2016-10-221-1/+24
| | | | | | Change-Id: Ie1e59c566b63d0dfac231e44e7ebd7f3f08f3e9f Signed-off-by: Ned Twigg <ned.twigg@diffplug.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* ArchiveTest: Don't use string concatenation in loopDavid Pursehouse2016-10-191-12/+12
| | | | | | | | | | | | | | According to FindBugs: In each iteration, the String is converted to a StringBuffer/ StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration. Replace string concatenation with StringBuffer. Change-Id: I60e09f274bed6722f4e0e4d096b0f2b1b31ec1b4 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* CLIRepositoryTestCase: Remove unused 'trash' memberDavid Pursehouse2016-10-191-4/+0
| | | | | Change-Id: I813f3de5f059e6e5cd34af20fce1e117bfe55b55 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Upgrade buck to 7b7817c48f30687781040b2b82ac9218d5c4eaa4David Pursehouse2016-10-181-1/+0
| | | | | | | | | | | | | | | | | Upgrade to match the version used on Gerrit's master branch. Requires a couple of modifications to make the tests work: - Remove source_under_test parameters from java_test calls. - Add vm_args with explicit setting of tmpdir location for http tests. This is needed due to upstream changes in temporary directory handling [1]. [1] https://github.com/facebook/buck/issues/946 Change-Id: I5d5dd5edc335d44b118e8587f69ba89b83fc7fbb Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix JGit CLI to follow native git's interpretation of http_proxy...Christian Halstrick2016-10-141-0/+232
| | | | | | | | | | | | | | | | | Native git (as many other tools) interprets the environment variables http_proxy, HTTP_PROXY, ... in a specific way. "http_proxy" has to be lowercase while "https_proxy" can be lowercase or uppercase (means: "HTTPS_PROXY"). Lowercase has precedence. This can be looked up in "ENVIRONMENT" section of [1]. Teach JGit CLI to behave similar. Additionally teach JGit not to interpret the environment variables if the java process was explicitly started with the system properties telling JVM which proxy to use. A call like "http_proxy=proxy1 java -Dhttp.proxyHost=proxy2 ..." should use proxy2 as proxy. [1] https://curl.haxx.se/docs/manpage.html Change-Id: I2ad78f209792bf8f1285cf2f8ada8ae0c28f8e5a
* Change JGit minimum execution environment to JavaSE-1.8Matthias Sohn2016-09-206-28/+7
| | | | | Bug: 500059 Change-Id: I47f3f6749a67da52029f84e002d9b155ed56d2b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.6.0-SNAPSHOT buildsMatthias Sohn2016-09-192-19/+19
| | | | | Change-Id: Id2eafc331ee32c332c2a9b867b05c260beb0d10f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* CLI: implement option -d for deleting tagsNed Twigg2016-08-311-0/+23
| | | | | Change-Id: I438456b76aefd361384729686271288186d3be3b Signed-off-by: Ned Twigg <ned.twigg@diffplug.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Added a clean command.Ned Twigg2016-08-301-0/+136
| | | | | Change-Id: I05d5392789b5b64e6ee44f678556cf25dc30d7ba Signed-off-by: Ned Twigg <ned.twigg@diffplug.com>
* Ignore 'The value of exception parameter is not used' warningDavid Pursehouse2016-07-261-0/+1
| | | | | Change-Id: I50407e4a33e35b718ca40503fdd436f1f9f70fba Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix DirCacheCheckout to return CheckoutConflictExceptionChristian Halstrick2016-06-231-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem occurs when the checkout wants to create a file 'd/f' but the workingtree contains a dirty file 'd'. In order to create d/f the file 'd' would have to be deleted and since the file is dirty that content would be lost. This should lead to a CheckoutConflictException for d/f when failOnConflict was set to true. This fix also changes jgit checkout semantics to be more like native gits checkout semantics. If during a checkout jgit wants to delete a folder but finds that the working tree contains a dirty file at this path then JGit will now throw an exception instead of silently keeping the dirty file. Like in this example: git init touch b git add b git commit -m addB mkdir a touch a/c git add a/c git commit -m addAC rm -fr a touch a git checkout HEAD~ Change-Id: I9089123179e09dd565285d50b0caa308d290cccd Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Also-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
* Merge "Add missing @Test annotations"Christian Halstrick2016-06-021-0/+1
|\
| * Add missing @Test annotationsHugo Arès2016-06-011-0/+1
| | | | | | | | | | Change-Id: Ie5ffcbf18233dc9b3eb232f714b5b58b6b93f4e0 Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
* | Prepare 4.5.0-SNAPSHOT buildsMatthias Sohn2016-06-012-19/+19
|/ | | | | Change-Id: I572fe9fea0e5ca0bec4648c916ae95a5b1ccf125 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit CLI: allow to call git init with specific directoryRüdiger Herrmann2016-05-222-1/+92
| | | | | | | | With this change it is possible to initialize repositories with 'git init /path/to/new/repo' Change-Id: Ia9b288b4fb34887e8f5e2f3f270e521c44d41b6a Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.4.0-SNAPSHOT buildsMatthias Sohn2016-04-082-19/+19
| | | | | Change-Id: If3162f4cc4ae6319b9f1e3293549485b039cfe7f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.3.1-SNAPSHOT versionsMatthias Sohn2016-04-082-19/+19
| | | | | Change-Id: I52c98ba8fb3a303269a1f9380af114b6dd8c5009 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.3.0.201604071810-rv4.3.0.201604071810-rMatthias Sohn2016-04-082-2/+2
| | | | | Change-Id: I902cdf1ff92ce8c6e9d80c4965d8d5bd8b9ac6c1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.3.0.201604071045-rMatthias Sohn2016-04-072-2/+2
| | | | | Change-Id: Iafab78d6be34d31a13f979b7be67611135c0f8bd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.3-SNAPSHOT buildsMatthias Sohn2016-04-052-2/+2
| | | | | Change-Id: Ib831f8870938113bd5338763f90a07d5c108b1de Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.3.0.201603230630-rc1v4.3.0.201603230630-rc1Matthias Sohn2016-03-232-2/+2
| | | | | Change-Id: I10835e5aa3618e5033424595942cc1649152cb24 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-4.2'Matthias Sohn2016-02-121-13/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * ReflogTest: Open Git instances in try-with-resourceDavid Pursehouse2016-02-121-13/+16
| | | | | | | | | | Change-Id: I950b6f16148cfe11de729b04904f88d6e4c28b9a Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
* | Merge branch 'stable-4.2'Matthias Sohn2016-02-101-16/+20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * RepoTest: Open Git in try-with-resourcesDavid Pursehouse2016-02-051-16/+20
| | | | | | | | | | | | | | | | 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>
| * Prepare 4.2.1-SNAPSHOT buildsMatthias Sohn2016-01-222-19/+19
| | | | | | | | | | 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>
| * Merge branch 'master' into stable-4.2Matthias Sohn2016-01-2116-128/+769
| |\ | | | | | | | | | Change-Id: Ieec4f51aedadf5734ae0e3f4e8713248a3c4fc52 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Prepare 4.3.0-SNAPSHOT buildsMatthias Sohn2016-01-212-19/+19
| | | | | | | | | | | | | | | Change-Id: Idcf0479529693b023042becd96698f9afd344bd4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge branch 'stable-4.2'Matthias Sohn2016-01-211-1/+3
|\| | | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * ConfigTest: Create Git instance in try-with-resourceDavid Pursehouse2016-01-211-1/+3
| | | | | | | | | | Change-Id: Ie65c69e0f1aed95bcdf68ebd68d21b3e2590b41c Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
* | Merge branch 'stable-4.2'David Pursehouse2016-01-202-292/+317
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * CheckoutTest: Create Git instances in try-with-resourceDavid Pursehouse2016-01-191-285/+306
| | | | | | | | | | Change-Id: I49a03f7bee0b61c062ce160674f9aa0cd1bcc8ba Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * BranchTest: Create Git instances in try-with-resourceDavid Pursehouse2016-01-191-8/+12
| | | | | | | | | | Change-Id: I8becee479fab91a18e6daffd6f4fd57338c9d120 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
| * Prepare 4.2.0-SNAPSHOT buildsMatthias Sohn2016-01-192-2/+2
| | | | | | | | | | Change-Id: Ibe38a95bf36db0c0ed948280b28c416943ec0329 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.2.0.201512141825-rc1v4.2.0.201512141825-rc1Matthias Sohn2015-12-152-2/+2
| | | | | | | | | | Change-Id: Id725ea888acd23793d37de2864ec0727160a2eaf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Make sure CLIGitCommand and Main produce (almost) same resultsAndrey Loskutov2016-01-063-106/+155
| | | | | | | | | | | | | | | | | | | | | | | | Currently execution of tests in pgm uses CLIGitCommand which re-implements few things from Main. Unfortunately this can results in a different test behavior compared to the real CLI runtime. The change let CLIGitCommand extend Main and only slightly modifies the runtime (stream redirection and undesired exit() termination). Change-Id: I87b7b61d1c84a89e5917610d84409f01be90b70b Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | branch command: print help if requested, even if arguments are wrongAndrey Loskutov2016-01-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | git branch -d -h reports an error (because of missing -d option value) but does not print the help as expected. To fix this, CmdLineParser must catch, print but do not propagate exceptions if help is requested. Bug: 484951 Change-Id: I51265ebe295f22da540792c6a1980b8bdb295a02 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | Added CLIText.fatalError(String) API for testsAndrey Loskutov2016-01-063-11/+11
| | | | | | | | | | | | | | | | | | | | In different places (Main, TextBuiltin, CLIGitCommand) we report fatal errors and at same time want to check for fatal errors in the tests. Using common API simplifies the error testing and helps to navigate to the actual error check implementation. Change-Id: Iecde79beb33ea595171f168f46b0b10ab2f339bb Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | branch command: provide convenient and meaningful options helpAndrey Loskutov2016-01-021-8/+176
| | | | | | | | | | | | | | Added tests for all options, fixed multi-valued options parsing. Bug: 484951 Change-Id: I5558589049544ea6c84932bc01f1f9df09e1f682 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>