aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Support --cached in RmCommandRobin Stocker2012-12-031-1/+15
| | | | | | | | Also extend documentation and add examples. Bug: 395599 Change-Id: Id1ddbc9da787472f82e58834092bc073224b262b Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* RevWalk support for shallow clonesMarc Strapetz2012-11-212-21/+216
| | | | | | | | | | | | StartGenerator now processes .git/shallow to have the RevWalk stop for shallow commits. See RevWalkShallowTest for tests. Bug: 394543 CQ: 6908 Change-Id: Ia5af1dab3fe9c7888f44eeecab1e1bcf2e8e48fe Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add support for rebase interactive 'edit' commandDariusz Luksza2012-11-191-0/+52
| | | | | | | | | | The 'edit' command allows you to change arbitrary commit content and the message of any commit in the repository. Bug: 394577 Change-Id: I43a44782cdb10b29f13784fa75ab37fe5d4da01b Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add support for rebase interactive 'reword' commandDariusz Luksza2012-11-191-0/+58
| | | | | | | | | | 'reword' command is used to change commit message of any commit in git history. Bug: 394575 Change-Id: Ic974e76dfd923fd6f0cb8f07d1a6fbecd9abbf31 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add GarbageCollectCommand to porcelain APIMatthias Sohn2012-11-181-0/+90
| | | | | | | Bug: 394544 Change-Id: I73faa55d860db64efc3412fee27386df47552a75 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add support for pull with --rebase and --no-rebaseMikael Karlsson2012-11-161-0/+70
| | | | | | Bug: 394501 Change-Id: I697e2fc82a46c03762111eb1de93e673a2643b4f Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Adapt Status and CleanCommand to support cleaning directoriesMarkus Duft2012-11-162-3/+99
| | | | | | | | | | | | | This adds the possibility to: * retrieve untracked directories from the status * instruct the CleanCommand to clean those directories. * retrieve ignored paths from the status * instruct the CleanCommand to leave those ignored paths alone Bug: 338717 Change-Id: Ibed0459005a5e306c010b9932f5b5fd107fb5448 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* CheckoutCommand: Support checking out ours and theirsRobin Stocker2012-11-161-3/+45
| | | | | | | | | | | The checkoutPaths body is split into two implementations, depending on whether we are checking out the index or a branch. This improves readability, as in the index case we now also need to have access to DirCacheIterator. Bug: 390147 Change-Id: I99fd599b25b2ace9bdd84535a56565286a3cb7f1 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Harmonize the JDT settings within JGitRobin Rosenberg2012-11-163-7/+81
| | | | | | | | | | | Note the the settings are slightly less restrictive for test bundles. -Also cleanup a couple of malformed javadocs -Update compiler warnings/errors to include default values from Juno -We now flag diagnosed null dereference as error. We didn't do that earlier because of some false positives. Change-Id: I58386d63164e65d3d8d1998da3390d99bdc7381a Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* DirCacheEditor: Apply PathEdit for each stageRobin Stocker2012-11-161-0/+43
| | | | | | | | | | | | This behavior was defined in the Javadoc of PathEdit, but not actually implemented. It's necessary when one wants to use a PathEdit to check out a specific stage in apply. Bug: 390147 Change-Id: Iaed5cf60c554fc17e6c4d188caf4f0231da920d0 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* CommitCommand: Ensure unmerged paths are added correctly with setOnlyRobin Stocker2012-11-121-0/+54
| | | | | | | | | | | | | With bug 391855, PathEdit will be changed to apply an edit for each stage. With that, CommitCommand would no longer work correctly when committing an unmerged path. This changes it to use a DirCacheBuilder which allows us to correctly replace the entries for the three stages with one, which is not possible with PathEdit. Bug: 391859 Change-Id: I6dc180aec7e2cbf8d1e91f50482c95bc420f79de
* Add ReflogCommandTest#testAmendReflogTomasz Zarna2012-11-011-0/+32
| | | | | | | | Add a test for reflog with an amend commit and add assertions for branch comments Change-Id: Ie44076ff1abf1f8954b85d8c74ac6cb41ab789cb Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* ResetCommand: Use DirCacheBuilder in resetIndexRobin Stocker2012-11-011-0/+30
| | | | | | | | | | | | | With bug 391855, DirCacheEditor's PathEdit will be applied for each stage. For an unmerged path, this would result in 3 equal entries for the same path. By using a DirCacheBuilder, the code is simpler and does not have the above problem with unmerged paths. Bug: 391860 Change-Id: I785deeaeb8474f8c7a7fbc9ef00d3131fac87e41 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* ResetCommand: Correctly reset unmerged paths in resetIndexForPathsRobin Stocker2012-11-011-0/+32
| | | | | | | | | The previous implementation used a PathEdit, which does not reset the stage of the entry. Bug: 391860 Change-Id: If26d3a35abfee85424ad69de724f06a28b6e9efb Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Merge "Refactor ResolveMergerTest to allow testing multiple strategies"Chris Aniszczyk2012-10-301-35/+67
|\
| * Refactor ResolveMergerTest to allow testing multiple strategiesChristian Halstrick2012-10-251-35/+67
| | | | | | | | | | | | | | By making use of JUnit Theories and Datapoints ResolveMergerTests is now capable to run the tests against multiple Merge strategies. Change-Id: Ifa0075e0a2aca7576ef268291b73fa2f4d79b591
* | Pull up method for creating DirCacheEntry into RepositoryTestCaseRobin Stocker2012-10-286-139/+95
| | | | | | | | Change-Id: I6e6522289553137df1a46ceeb52f461e9d25a290
* | Suppress resource warnings with Java 7Robin Rosenberg2012-10-257-17/+43
| | | | | | | | | | | | | | | | | | | | | | For streams that should not be closed, i.e. don't own an underlying stream, and in-memory streams that do not need to be closed we just suppress the warning. This mostly apply to test cases. GC is enough. For streams with external resources (i.e. files) we add the necessary call to close(). Change-Id: I4d883ba2e7d07f199fe57ccb3459ece00441a570
* | Merge "Add a check in fstick that the reference file exists"Shawn Pearce2012-10-251-0/+2
|\ \
| * | Add a check in fstick that the reference file existsRobin Rosenberg2012-10-251-0/+2
| | | | | | | | | | | | | | | | | | This helps avoiding some stupid thinkos. Change-Id: I5b386cd9c6bf0e11f270bb2b8cfaac66ce9b341b
* | | Merge "Fix for Iff768422c, use offset 0 when going back to work tree iterator"Shawn Pearce2012-10-251-0/+41
|\ \ \ | |/ / |/| |
| * | Fix for Iff768422c, use offset 0 when going back to work tree iteratorRobin Rosenberg2012-10-061-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Iff768422c the offset used for the content id was fixed to use the offset that applied to the dircache iterator. Unfortunately the index for the dircache content id offset stuck for entries that were not in the index. Few caller probably cared about that, unless it actually caused an ArrayIndexOutOfBoundsException. Change-Id: Ic9f0e77c8ea3a0770d88565e94392e76853e3006
* | | Merge "Don't allow null name or e-mail in PersonIdent"Shawn Pearce2012-10-251-0/+10
|\ \ \ | |_|/ |/| |
| * | Don't allow null name or e-mail in PersonIdentRobin Stocker2012-10-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | toExternalString, equals and hashCode don't expect them to be null, so explicitly disallow it in the constructor. Also fix the documentation of setAuthor and setCommitter in CommitCommand when specifying name and email as separate arguments. Bug: 352984 Change-Id: I0ac994ae8e47789d38f7c6e6db55d482f0f1bac3
* | | StashCreateCommand: Abort in case of unmerged pathsRobin Stocker2012-10-222-0/+46
|/ / | | | | | | | | Bug: 391861 Change-Id: I5f8ffe072c08c8ca2ca6be6b6afa67c8e16a63b6
* | CommitCommand: Use original author on amend if author is not setRobin Stocker2012-10-081-0/+44
| | | | | | | | | | | | | | This way, callers don't have to parse author ident of HEAD themselves. Bug: 362391 Change-Id: I383a817e6ed4707d637c52c007bc7b57728e6c85
* | CommitCommand: Don't allow amending on initial commitRobin Stocker2012-10-081-0/+7
|/ | | | Change-Id: I27b13510eb6756da21d0d359d76031da4a875e28
* Fix unstable testRobin Rosenberg2012-10-021-1/+1
| | | | | | | | | Add more time to a timestamp to safely go beyond the granularity of the timestamp resolution of the file system. The lowest resolution we know of is FAT with two second resolution. Then add some to make sure we are above the limit. Change-Id: I85c5b07dcdf2d80de41fe9b2354ccc888bad7f1e
* Remove unused import introduced with 8f706db5Matthias Sohn2012-09-251-2/+2
| | | | | | Also cleanup wildcards in import statements. Change-Id: I28c1435ae7482de1209aeefc755a230ef5b8c15d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Provide a convenient read() in RepositoryTestCase"Christian Halstrick2012-09-251-0/+4
|\
| * Provide a convenient read() in RepositoryTestCaseRobin Stocker2012-09-251-0/+4
| | | | | | | | | | | | | | For reading a file by its repository-relative path, analogous to writeTrashFile. Change-Id: I112de0d57c2ee1bd425de6cbf561a57fea7147f0
* | Merge "Add the intended file to avoid breakage"Christian Halstrick2012-09-251-1/+1
|\ \ | |/ |/|
| * Add the intended file to avoid breakageRobin Rosenberg2012-09-251-1/+1
| | | | | | | | | | | | This case breaks when the default is to disallow empty commits. Change-Id: Ibc223092eefe9f4b21374717dee5a9399bf890f9
* | Merge "Allow @ in branch names and tighten syntax checking"Robin Rosenberg2012-09-241-0/+53
|\ \
| * | Allow @ in branch names and tighten syntax checkingRobin Rosenberg2012-09-231-0/+53
| |/ | | | | | | | | | | | | | | | | | | Valid refs are defined by git-check-ref-format(1). In addition we will not try to perform a lookup of an invalid ref name in Repository.resolve(). Reported by R Shapiro in the Eclipse JGit Forum. Change-Id: I0b098eec9ecb98a9ce16b1cfb476729aaf2fb190
* | Merge "FileBasedConfig supports UTF-8 byte order marker"Robin Rosenberg2012-09-241-0/+162
|\ \
| * | FileBasedConfig supports UTF-8 byte order markerMarc Strapetz2012-09-241-0/+162
| | | | | | | | | | | | Change-Id: I1f5dc07182dbf6bba2a9f4807fdd25b475da4ead
* | | Merge "Refuse to checkout unmerged paths from index"Christian Halstrick2012-09-241-0/+21
|\ \ \
| * | | Refuse to checkout unmerged paths from indexRobin Stocker2012-09-231-0/+21
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Without this check, the checkout was done but the result was a "both deleted" status when inspecting it with C Git. Found this while working on bug 390147. Change-Id: Ic3693f2c651827239e838bf7f37da842a7ae9707
* / | Comment an empty block which is okRobin Rosenberg2012-09-231-0/+1
|/ / | | | | | | Change-Id: I552d4481e17a12b0bd707d5386f29026ae0856fb
* | Suppress boxing warnings where we know they are okRobin Rosenberg2012-09-2212-21/+37
| | | | | | | | | | | | | | | | | | Invoke the wrapper types' valueOf via static imports. For booleans used in asserts, add a new assert in the JUnit utility package since out current version of JUnit does not have the assert(boolean, boolean) method. Change-Id: I9099bd8efbc8c133479344d51ce7dabed8958a2b
* | Fixed instability in some GC tests.Sasa Zivkov2012-09-201-11/+7
|/ | | | | | | | | | | | | | | Some GC tests were sporadically failing. The reason was that they used the setExpireAgeMillis method to define object expiration before invoking the prune method. Depending on the CPU load during the test run, the prune method may reach an object (which is considered non-expired by the test) too late and actually prune it. To make the test stable we now use the setExpire(Date expire) method and define a time instant before which objects are considered to be expired. This way the outcome of the prune method doesn't depend on the CPU load. Change-Id: Ifc3323ca55ae56dbccdbc90a282ec3cf18ad7297 Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
* Prepare 2.2.0 buildsMatthias Sohn2012-09-192-33/+33
| | | | | Change-Id: I386ba70541d644e58661d26713b309371e0f9257 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-2.1'Matthias Sohn2012-09-192-24/+111
|\ | | | | | | | | | | | | | | | | | | | | | | * stable-2.1: Prepare for 2.1 maintenance changes JGit v2.1.0.201209190230-r Introduce "never" as parseable date Introduce ParseExceptions for GitDateParser Support config param "gc.pruneexpire" Change-Id: If149d7f968a3425d9425f6ba9ce135a8341776a7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare for 2.1 maintenance changesstable-2.1Matthias Sohn2012-09-192-2/+2
| | | | | | | | Change-Id: I436f36a7c6dc86916eb4cde038b27f9fb183465a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v2.1.0.201209190230-rv2.1.0.201209190230-rMatthias Sohn2012-09-192-2/+2
| | | | | | | | | | Change-Id: I9f94bce9a25644575a068c8fa459f74e06b02030 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Introduce "never" as parseable dateRobin Rosenberg2012-09-181-0/+11
| | | | | | | | | | | | | | | | | | | | For configuration parameter like "gc.pruneexpire" we need to understand the value "never". Never is handled as a date so far into the future that it will never happen. The actual value currently used is the constant GitDateParser.NEVER. Change-Id: I7744eaee9bf5026da517151c212c88325c348d6c Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
| * Introduce ParseExceptions for GitDateParserChristian Halstrick2012-09-172-24/+100
| | | | | | | | | | | | | | | | | | Instead of just returning null when something was not parseable we should throw a real ParseException. This allows us to distinguish between specifications which are unparseable and those which represent no date (e.g. "never") Change-Id: Ib3c1aa64b65ed0e0270791a365f2fa72ab78a3f4
* | Merge "Fix resolving expression with ~ and ^ than extends beyond history"Robin Rosenberg2012-09-182-1/+386
|\ \
| * | Fix resolving expression with ~ and ^ than extends beyond historyDave Borowitz2012-09-181-0/+23
| |/ | | | | | | | | | | | | | | | | | | | | | | resolve("foo~X") where X is greater than the distance from foo to the root should return null, but 2a2362fb introduced a bug causing it to either return resolve("foo") or NPE. Add a test for the correct behavior. Also add an analogous test for foo^X where X is greater than the number of parents (which was not broken by that commit). Change-Id: Ic580081ece57c8c2df29b652897b425ecb34e11f