summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
Commit message (Collapse)AuthorAgeFilesLines
* Prepare 4.3.0-SNAPSHOT buildsMatthias Sohn2016-01-212-17/+17
| | | | | Change-Id: Idcf0479529693b023042becd96698f9afd344bd4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* 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>
* PackWriter: Declare preparePack object sets as @NonNullShawn Pearce2016-01-121-1/+1
| | | | | | | | Require callers to pass in valid sets for both want and have collections. Offer PackWriter.NONE as a handy constant for an empty collection for the have part of preparePack instead of null. Change-Id: Ifda4450f5e488cbfefd728382b7d30797e229217
* Merge changes Idaed9310,I62bd7c0bMatthias Sohn2016-01-031-2/+2
|\ | | | | | | | | | | * changes: ObjectChecker: honor some git-core fsck.* options ObjectChecker: allow some objects to skip errors
| * ObjectChecker: allow some objects to skip errorsShawn Pearce2015-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some ancient objects may be broken, but in a relatively harmless way. Allow the ObjectChecker caller to whitelist specific objects that are going to fail checks, but that have been reviewed by a human and decided the objects are OK enough to permit continued use of. This avoids needing to rewrite history to scrub the broken objects out. Honor the git-core fsck.skipList configuration setting when receiving a push or fetching from a remote repository. Change-Id: I62bd7c0b0848981f73dd7c752860fd02794233a6
* | Implement Buck driven buildDavid Ostrovsky2015-12-311-0/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today there are plenty of modern build tool systems available in the wild (in no particular order): * http://bazel.io * https://pantsbuild.github.io * http://shakebuild.com * https://ninja-build.org * https://buckbuild.com The attributes, that all these build tools have in common, are: * reliable * correct * very fast * reproducible It must not always be the other build tool, this project is currently using. Or, quoting Gerrit Code Review maintainer here: "Friends, don't let friends use <the other build tool system>!" This change is non-complete implementation of JGit build in Buck, needed by Gerrit Code Review to replace its dependency with standlone JGit cell. This is very useful when a developer is working on both projects and is trying to integrate changes made in JGit in Gerrit. The supported workflow is: $ cd jgit $ emacs <hack> $ cd ../gerrit $ buck build --config repositories.jgit=../jgit gerrit With --config repositories.jgit=../jgit jgit cell is routed through JGit development tree. To build jgit, issue: $ buck build //:jgit [-] PROCESSING BUCK FILES...FINISHED 0,0s Yes, you can't measure no-op build time, given that Buck daemon is used. Change-Id: I301a71b19fba35a5093d8cc64d4ba970c2877a44 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
* Add support for clean filtersChristian Halstrick2015-11-271-0/+13
| | | | | | | | | When filters are defined for certain paths in gitattributes make sure that clean filters are processed when adding new content to the object database. Change-Id: Iffd72914cec5b434ba4d0de232e285b7492db868 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing @since tags and missing javadocMatthias Sohn2015-11-255-2/+32
| | | | Change-Id: I8575797127fc96abea8af56f019ca39f5897486f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Restore TestRepository.getClock(), it is used by Gerrit/GitilesTerry Parker2015-10-221-0/+11
| | | | | Change-Id: I88880f18998e33377c0c684cbd8007b5d27d76e7 Signed-off-by: Terry Parker <tparker@google.com>
* Push control of time into MockSystemReaderTerry Parker2015-10-203-25/+55
| | | | | | | | | | | LocalDiskRepositoryTestCase and TestRepository have competing ideas about time. Push them into MockSystemReader so they can cooperate. Rename getClock() methods that return Dates to getDate(). Change-Id: Ibbd9fe7f85d0064b0a19e3b675b9718a9e67c479 Signed-off-by: Terry Parker <tparker@google.com>
* Delete non empty directories before checkout a pathAndrey Loskutov2015-10-092-0/+13
| | | | | | | | | | If the checkout path is currently a non-empty directory (and was a link or a regular file before), this directory will be removed before performing checkout, but only if the checkout path is specified. Bug: 474973 Change-Id: Ifc6c61592d9b54d26c66367163acdebea369145c Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* Prepare 4.2.0-SNAPSHOT buildsMatthias Sohn2015-09-282-17/+17
| | | | | Change-Id: If559d3565b1f84c93a533e1ce18d5293605d1950 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.1.1-SNAPSHOT buildsMatthias Sohn2015-09-282-17/+17
| | | | | Change-Id: I035f3a8d0f0de86e8b8f00e668be5ce008402e82 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.1.0.201509280440-rv4.1.0.201509280440-rMatthias Sohn2015-09-282-2/+2
| | | | | Change-Id: I9a536870b9f5c1247c52d6c976a954115982fa1c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [performance] Cache platform name in SystemReaderAndrey Loskutov2015-09-271-0/+18
| | | | | | | | | SystemReader.isMacOs() and SystemReader.isWindows() return values are unlikely to change during the JVM lifetime (except tests). Don't read system properties each time the methods are called, just use previously calculated value. Change-Id: I495521f67a8b544e7b7247d99bbd05a42ea16d20 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* Restore lazy Bundle-ActivationPolicy removed in 3a4a5a4eMatthias Sohn2015-08-311-0/+1
| | | | | | | | This header was removed unintentionally from some bundles in 3a4a5a4e57f41c595ba950ea6f6680260669bf34. Restore it to ensure lazy activation of bundles. Change-Id: I1f841f978fb93278e3ec0533a01f1363510dd976 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Update uses-clauses in OSGi manifestsMatthias Sohn2015-08-311-2/+9
| | | | | | | | | | In Bug 476164 it was reported that EGit doesn't start when the platform comes with jsch 0.1.51 while this version of EGit/JGit brings jsch 0.1.53. This could be caused by outdated uses-clauses. Hence recompute them using PDE tooling. Bug: 476164 Change-Id: I185ba097884ead9cd034eba842bd3bf34181a99b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Move `RepositoryTestCase.indexState` to parent classChris Price2015-07-102-106/+100
| | | | | | | | | | | | | | | The test helper method `indexState` in `RepositoryTestCase` is very useful for writing tests, even in cases where we need to do things like create more than one repository for a test and thus we don't want to use the built-in `db` member variable that exists in `RepositoryTestCase`. Since the method is static, we can move it up to the parent class `LocalDiskRepositoryTestCase`, where it can be used by tests that aren't a great fit for inheriting directly from `RepositoryTestCase`. Bug: 436200 Change-Id: I2b6de75c001d2d77ddb607488af246548784a67f Signed-off-by: Chris Price <chris@puppetlabs.com>
* Change `indexState` to static methodChris Price2015-07-101-1/+1
| | | | | | | | | The `indexState` method is no longer referring to any member variables from the class, so it can be made static. Bug: 436200 Change-Id: I013316de5c373417ea758ca6e17da29209fead53 Signed-off-by: Chris Price <chris@puppetlabs.com>
* Use local variable in RepositoryTestCase.indexStateChris Price2015-07-071-1/+1
| | | | | | | | | | | | | | | | | There is a signature of the test helper method `indexState`, in `RepositoryTestCase`, that accepts a `Repository` object as an argument. However, there was one line of code where this variable was not being used, and the method was instead referring to a member variable `db`. I believe this was probably just an oversight in a previous refactor, and that the correct behavior is to use the variable from the argument list. This change also has the benefit of making it possible to convert this method to a static method, since it no longer relies on any state from the class. Bug: 436200 Change-Id: Iac95b046dc5bd0b3756642e241c3637f1fad3609 Signed-off-by: Chris Price <chris@puppetlabs.com>
* Prepare 4.1.0-SNAPSHOT buildsMatthias Sohn2015-06-032-17/+17
| | | | | Change-Id: I03d08b8e2d3400d4b5cdb4ab541b312870776843 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Replace deprecated release() methods by close()Matthias Sohn2015-05-211-27/+29
| | | | | | | | See the discussion [1] in the Gerrit mailing list. [1] https://groups.google.com/forum/#!topic/repo-discuss/RRQT_xCqz4o Change-Id: I2c67384309c5c2e8511a7d0d4e088b4e95f819ff Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* TestRepository: Add a cherryPick methodDave Borowitz2015-03-232-0/+63
| | | | | | | | | | CherryPickCommand only works on a non-bare repository, as it must modify the working tree and index in case of a merge conflict. In tests, being able to recover from a merge conflict is less important, as the caller should be able to control the full contents of files in advance of the cherry-pick. Change-Id: Ic332e44df1308b9336e884666b08c1f6db64513d
* TestRepository: Expose a Git instanceDave Borowitz2015-03-181-0/+12
| | | | Change-Id: I2fab7dd9a24205686db4724e77c0fd0a28f2075e
* TestRepository: Allow setting explicit Change-IdDave Borowitz2015-03-121-9/+22
| | | | | | | This includes both leaving existing Change-Ids alone (as, for example Gerrit's commit-msg hook does) and programmatically setting a value. Change-Id: Iaaffb0107ae27de24df1f0e95a8d628fb8ea5364
* TestRepository: Ignore existing Change-Id in messageDave Borowitz2015-03-121-0/+4
| | | | Change-Id: I343c3065fa369ef8aab2b033ac1e392b28d10daf
* TestRepository: Support committing to unborn symrefDave Borowitz2015-03-121-2/+1
| | | | Change-Id: I6bcee635adda7c929f6fa68ef20438fe77e49184
* TestRepository: Expose some getters for CommitBuilderDave Borowitz2015-03-121-0/+16
| | | | Change-Id: Ic6d179bd2de0081633c22fb82ca68ea619cb686f
* TestRepository: Add methods to amend commits or refsDave Borowitz2015-03-121-12/+87
| | | | Change-Id: I47082416f6e281262b160ba15272258f9109abd1
* TestRepository: Add a reset method to move HEAD aroundDave Borowitz2015-03-121-0/+55
| | | | | | | | | This flushed out a number of bugs in the way DfsRefUpdate, or at least the InMemoryRepository implementation, processes symrefs. These have been fixed, to an extent, in InMemoryRepository, but other implementations may still suffer from these bugs. Change-Id: Ifd12115a0060b9ff45a88d305b72f91ca0472f9a
* TestRepository: Optionally insert Change-Id in commit messageDave Borowitz2015-03-121-1/+25
| | | | | | Copied the implementation from CommitCommand. Change-Id: Iade0e2d70bde70cfa830fe23bcc41959b011a14a
* TestRepository: Allow custom author/committer per-commitDave Borowitz2015-03-111-9/+32
| | | | Change-Id: I078fe00470ebe60f93f4a718c163dd1412fdc776
* TestRepository: Use try-with-resources where appropriateDave Borowitz2015-03-111-74/+58
| | | | Change-Id: I06f9534ab84278df37a140700fc2bed5ab667299
* Set minimum required Java version to Java 7Matthias Sohn2015-02-093-5/+5
| | | | | | Bug: 458475 Change-Id: Iea8f2236d4e6a94a8d14bb8cc685006ea3fd1bb7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 4.0.0-SNAPSHOT buildsMatthias Sohn2015-01-272-16/+16
| | | | | Change-Id: I414ba8ccc82866d3107ba7083a567ea70c879bdf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 3.7.0-SNAPSHOT buildsMatthias Sohn2014-12-242-16/+16
| | | | | Change-Id: Ib3e7b5f46ee1e27b9cf25b3b2d01d681a5c4904c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 3.6.1-SNAPSHOT buildsMatthias Sohn2014-12-232-16/+16
| | | | | Change-Id: Ie620c90ffafbffc6755b4e1ed55a61a15b118a2a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.6.0.201412230720-rv3.6.0.201412230720-rMatthias Sohn2014-12-232-2/+2
| | | | | Change-Id: Ic28e2bbbdb1099e948c64a005c39f6b8d8ac69a8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix junit tests under windows when the platform is explicitly changedChristian Halstrick2014-12-221-0/+2
| | | | | | | | | | | | SystemReader used a chached ObjectChecker which was instantiated only once. But in case of unit tests where we can change the platform dynamically (e.g. MockSystemReader.setWindows()) this is wrong and caused DirCacheCheckoutMaliciousPathTest. testMaliciousAbsoluteCurDrivePathWindowsOnUnix() to fail. This change allows user of SystemReader to force the creation of a new ObjectChecker. MockSystemReader.setWindows() and .setUnix() make use of this feature. Change-Id: I87458d1dc63c1f5c18979f972b1c1f0d670a9ed8
* Allow explicit configuration of git directory in InitCommandChristian Halstrick2014-12-151-0/+1
| | | | | | | | | | | | | | Native git's "init" command allows to specify the location of the .git folder with the option "--separate-git-dir". This allows for example to setup repositories with a non-standard layout. E.g. .git folder under /repos/a.git and the worktree under /home/git/a. Both directories contain pointers to the other side: /repos/a.git/config contains core.worktree=/home/git/a . And /home/git/a/.git is a file containing "gitdir: /repos/a.git". This commit adds that option to InitCommand. This feature is needed to support the new submodule layout where the .git folder of the submodules is under .git/modules/<submodule>. Change-Id: I0208f643808bf8f28e2c979d6e33662607775f1f
* Fix LocalDiskRepositoryTestCase to create correct type of reposChristian Halstrick2014-12-121-1/+1
| | | | | | | | | In one place LocalDiskRepositoryTestCase was ignoring the specification whether to create a bare or non-bare repository. Fix this and fix also one test which fails now because bare repos don't write reflogs by default. Change-Id: I4bcf8cf97c5b46e2f3919809eaa121a8d0e47010 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare post 3.6.0-m1 buildsMatthias Sohn2014-11-122-2/+2
| | | | | Change-Id: Ie9927de64fa6b7d517f96b8cd12e57541f284ff2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.6.0.201411121045-m1v3.6.0.201411121045-m1Matthias Sohn2014-11-122-2/+2
| | | | | Change-Id: I9d789113d88cbbbdbabb8919f80c805aa4ba86fe Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 3.6.0-SNAPSHOT buildsMatthias Sohn2014-09-052-16/+16
| | | | | Change-Id: I2d8c3768998c0cfc8d02d11009bc5b7ed1d75778 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix RecursiveMerger's internal use of merge to find a merge baseChristian Halstrick2014-07-252-0/+9
| | | | | | | | | | | | | | | | | | When RecursiveMerger tried to determine a common base tree it was recursively tried to merge multiple common bases. But these intermediate merges which have just been done to determine a single common base for the final merge already filled some important fields (toBeCheckedOut, toBeDeleted, ...). These side effects of the intermediate merges led to wrong results of the final merge. One symptom was that after a recursive merge which should be succesful you could still see leftover files in the worktree: files which existed in the (virtual) common base but which don't exist anymore in the branches to be merged. The solution is easy: Clear the appropriate fields after common base determination and start the final merge with a clean state. Change-Id: I644ea9e1cb15360f7901bc0483cdb9286308c226 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Don't warn for methods that can be staticRobin Rosenberg2014-07-021-1/+1
| | | | | | | | Making the methods static would gain little in performance, make the code harder to change. Removing unncessary warnings is more important. Change-Id: If3e6aa9c1d92e58b4e7a8e246cf4aace237d7a7b
* Add new default settings from Eclipse 4.4Robin Rosenberg2014-07-021-0/+5
| | | | | | | | These settings were added by Eclipse simply by touching the project settings. Adding these makes it simpler to see what local changes have been made. Change-Id: Iab0aa62530312eb0c78b03b5c6a632742bcc4978
* Try to fix intermittent test failure related to file timestampsRobin Rosenberg2014-07-011-3/+4
| | | | | | | | | | Improve how tests do a "touch" operation on files. Instead of doing "f.setLastModified(System.currentTimeMillis)" open a Outputstream on the file and directly close it again. This makes this method rely only on one clock - the clock of the filesystem. Bug: 436917 Change-Id: I68ef3c2878f28b12daebf2ef6a9fa0a5d6e0964d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 3.5.0-SNAPSHOT buildsRobin Rosenberg2014-06-042-16/+16
| | | | | Change-Id: I53bd500188e09ae2e007a58b3cd89aa0805d6f2a Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Prepare post 3.4.0 RC1 buildsMatthias Sohn2014-05-212-2/+2
| | | | Change-Id: Ia8d29046439bc9134acdf7c88ab85ea49c4ddf47 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>