aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Update HEAD in cherry-picking several commitsHiroshi Tomita2013-07-011-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without update, index is wrongly detected to be dirty when picking the second commit. Change-Id: Idf47ecb33e8bd38340d760806d629f67be92d2d5 Signed-off-by: Hiroshi Tomita <tomykaira@gmail.com> Bug: 411963
* | | | | Implement get nth offset in PackIndex.Colby Ranger2013-06-281-0/+15
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the offset can only be retrieved by ObjectId or iterating all of the entries. Add a method to lookup the offset by position in the index sorted by SHA1. Change-Id: I45e9ac8b752d1dab47b202753a1dcca7122b958e
* | | | Fix HTTP response processing for WWW-Authenticate headersAlex Rukhlin2013-06-231-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original code was able to process only one WWW-Authenticate header in an HTTP response, and if this header was not one of two expected, authentication failed regardless of that there could be other headers in the response. All WWW-Authenticate headers in an HTTP response have to be browsed to find one of supported, i.e. Basic or Digest. By that if both are present, the Digest one should be used as more preferable. Bug: 357719 Change-Id: Icf601a41fec63f7d40308f3c85aaa4f71a7c095b Signed-off-by: Alex Rukhlin <arukhlin@microsoft.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Add a method to DfsOutputStream to read as an InputStreamDave Borowitz2013-06-192-0/+151
| | | | | | | | | | | | | | | | Change-Id: I0ec1f17a88bc14f22c10f9bc8d6f5b5118410e3a
* | | | Fix tests for OS X when the tmpdir is the default /tmpRobin Rosenberg2013-06-161-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /tmp is a symbolic link and some tests break when the path gets canonicalized by JGit or Jetty. Allow Jetty to serve symlinks by setting init parameter "aliases" to true [1]. [1] http://wiki.eclipse.org/Jetty/Howto/How_to_serve_symbolically_linked_files Change-Id: I45359a40435e8a33def6e0bb6784b4d8637793ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Disable warning about assigning to parameterRobin Stocker2013-06-151-1/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | See change I08bed4275af9ec52aa4d7054067ac82f6a3c9781, where fixing such warning lead to complaints. If fixing is not wanted, disable it instead. Change-Id: If31d4028fa1c6377a11e83ed5688b45701cec68b
* | | Merge "document empty blocks in StashApplyCommandTest"Matthias Sohn2013-06-141-0/+3
|\ \ \
| * | | document empty blocks in StashApplyCommandTestTomasz Zarna2013-06-131-0/+3
| | | | | | | | | | | | | | | | Change-Id: I5b49bd00b00b86584b912fc5f503abf29db0f56e
* | | | Prepare 3.1.0-SNAPSHOT buildsMatthias Sohn2013-06-132-37/+37
| | | | | | | | | | | | | | | | | | | | Change-Id: I7490a7c9558423c03e3c167ad55b9a98be9d99d9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Merge branch 'stable-3.0'Matthias Sohn2013-06-134-9/+6
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Prepare post 3.0.0.201306101825-r builds JGit v3.0.0.201306101825-r Make JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler) Fix version.sh to not overwrite ${project.version} Prepare post 3.0.0 RC3 builds JGit v3.0.0.201306040240-rc3 Change-Id: I5b1db1f5b69bad1136dd21b956e798f63b1ba0ee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare post 3.0.0.201306101825-r buildsMatthias Sohn2013-06-132-2/+2
| | | | | | | | | | | | | | | Change-Id: I299cf1addc0987ffe39140d2216ab6a98e95ce52 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.0.0.201306101825-rv3.0.0.201306101825-rMatthias Sohn2013-06-112-2/+2
| | | | | | | | | | | | | | | Change-Id: Ie8deab94c6263b5198f0bcb4533b1cfb3f5724b1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Make JGit test work with both hamcrest 1.1 (juno) and 1.3 (kepler)Robin Rosenberg2013-06-094-9/+6
| | | | | | | | | | | | | | | | | | | | | The hamcrest library has moved things around. This problem applies only to the test, not plugin runtime. Change-Id: I5b97f356d8595dbdc9e91d157558e40561a6a30d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare post 3.0.0 RC3 buildsMatthias Sohn2013-06-042-2/+2
| | | | | | | | | | | | | | | Change-Id: I008d55e2ef0aac9d1877b05ba73e3cf26335d430 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.0.0.201306040240-rc3v3.0.0.201306040240-rc3Matthias Sohn2013-06-042-2/+2
| | | | | | | | | | | | | | | Change-Id: I8b782e9ebe03e5f72611a21a76d80c6b20cb7845 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge branch 'stable-3.0'Matthias Sohn2013-05-296-14/+375
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.0: Prepare post 3.0.0-rc2 builds JGit v3.0.0.201305281830-rc2 Support refspecs with wildcard in middle (not only at end) Fix multiple bugs in RawSubStringPattern used by MessageRevFilter Handle short branch/tag name for setBranch in CloneCommand Add missing Bundle-Localization header Apply tree filter marks when pairing DiffEntry for renames Improve feature names to become understandable by end users Update kepler orbit version to R20130517111416 Fix BatchRefUpdate progress-monitoring so it doesn't count twice Fix AnyObjectId's generic type declaration of Comparable Fix DiffFormatter NPEs for DiffEntry without content change Fix CommitCommand not to destroy repo Fix the parameters to an exception Prepare post 3.0.0 M7 builds JGit v3.0.0.201305080800-m7 Change-Id: Ia8441c9796f01497e0d90e672c0aaf60520a0098 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare post 3.0.0-rc2 buildsMatthias Sohn2013-05-292-2/+2
| | | | | | | | | | | | Change-Id: Ic46832bcde80d0bf74c16cb094abd76b00552d14 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.0.0.201305281830-rc2v3.0.0.201305281830-rc2Matthias Sohn2013-05-292-2/+2
| | | | | | | | | | | | | | | Change-Id: I490ad8cc7590f70783d3fbd6dd6f0e0446ae5afe Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Support refspecs with wildcard in middle (not only at end)Robin Stocker2013-05-281-0/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following refspec, which can be used to fetch GitHub pull requests, is supported by C Git but was not yet by JGit: +refs/pull/*/head:refs/remotes/origin/pr/* The reason is that the wildcard in the source is in the middle. This change also includes more validation (e.g. "refs//heads" is not valid) and test cases. Bug: 405099 Change-Id: I9bcef7785a0762ed0a98ca95a0bdf8879d5702aa
| * | Fix multiple bugs in RawSubStringPattern used by MessageRevFilterRobin Stocker2013-05-281-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Match at end of input was not handled correctly. * When more than one character matched but not all, the next character was not considered as a match start (e.g. pattern "abab" didn't match input "abaabab"). Bug: 409144 Change-Id: Ia44682c618bfbb927f5567c194227421d222a160 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Handle short branch/tag name for setBranch in CloneCommandRobin Stocker2013-05-261-6/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, it was not clear from the documentation what kind of branch name was accepted. Users specifying "branch" (instead of "refs/heads/branch") got no error message and ended up with a repository without HEAD and no checkout. With this, CloneCommand now tries "$branch", then "refs/heads/$branch" and then "refs/tags/$branch". C Git only does the last two, but for compatibility we should still allow "refs/heads/branch". Bug: 390994 Change-Id: I4be13144f2a21a6583e0942f0c7c40da32f2247a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Fix BatchRefUpdate progress-monitoring so it doesn't count twiceRoberto Tyley2013-05-191-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was seeing output like this while running The BFG: Updating references: 200% (374/187) ...issue sneaked in with 5cf53fda I think. The update call is also moved to the end of the loop, as update() is only supposed to be called after work has been done ("Denote that some work units have been completed"). Change-Id: I1620fa75be16dc80df44745d0e123ea512762e31 Signed-off-by: Robin Stocker <robin@nibor.org>
| * | Fix DiffFormatter NPEs for DiffEntry without content changeRobin Stocker2013-05-151-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | DiffEntry.getOldId() returns null for a diff without an index line (e.g. only mode changed, rename without content change). Bug: 407743 Change-Id: I42eac87421f2a53c985af260a253338f578492bc
| * | Fix CommitCommand not to destroy repoChristian Halstrick2013-05-111-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a severe bug in CommitCommand which could corrupt repos. When merging an annotated tag the JGit MergeCommand writes correctly the ID of the tag (and not the id of the commit the tag was pointing to) into MERGE_HEAD. Native git does the same. But CommitCommand was reading this file and trusting blindly that it will contain only IDs of commits. Then the CommitCommand created a commit which has as parent a non-commit object (the tag object). That's so corrupt that even native git gives up when you call "git log" in such a repo. To reproduce that with EGit simply right-click on a tag in the Repository View and select Merge. The result was a corrupt repo! Bug: 336291 Change-Id: I24cd5de19ce6ca7b68b4052c9e73dcc6d207b57c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare post 3.0.0 M7 buildsMatthias Sohn2013-05-082-2/+2
| | | | | | | | | | | | Change-Id: I062c44529c7ae2f960d3c64a0923a45d2dc8a863 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.0.0.201305080800-m7v3.0.0.201305080800-m7Matthias Sohn2013-05-082-2/+2
| | | | | | | | | | | | | | | Change-Id: I377b174993862918a117f54e6cba4733dfc2307c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix hardcoded use of target/trash in LocalDiskRepositoryTestCaseShawn Pearce2013-05-082-12/+11
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `pwd`/target is only valid in Maven Reactor builds where Maven has moved into the project directory and created a target for the build output. Most other build systems do not use "target" and may not even perform a directory change between test suites. Rewrite LocalDiskRepositoryTestCase's temporary directory code to use the system specified location and create new unique names. This prevents fixes between concurrently running tests and allows the caller to specify the root using java.io.tmpdir. Update the surefire command lines to use target within each project as the system temporary directory during unit testing, preventing JGit's own test suite from writing to /tmp or somewhere like C:\tmp. Change-Id: I9e8431f6ddfc16fee89f677bcce67c99cfb56782
* | Move org.eclipse.jgit.pgm's resource bundle to internal packageMatthias Sohn2013-05-062-1/+2
| | | | | | | | | | | | | | | | Translatable texts aren't API and shouldn't require maintenance of @since tags to prevent API warnings. Change-Id: I228ff37f17c0e792a6bc188c463a0d19138e88ac Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "URIish: Allow multiple slashes in paths"Shawn Pearce2013-05-051-2/+18
|\ \
| * | URIish: Allow multiple slashes in pathsRobin Stocker2013-04-271-2/+18
| | | | | | | | | | | | | | | | | | It's also allowed by C Git. Change-Id: Ie0a0d1f57d84e70fd5ef50b7844d22fea43d0e08
* | | Remove unused repository field from RevWalkDave Borowitz2013-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The comment about legacy Tag and Object types no longer applies, though prior to Idb273d5a92849b42935ac14eed73b796b80aad50 the field was still being used by RewriteTreeFilter. Change-Id: I9ee5da8f8a3b61c9cf543817c03117ee0609dd8f
* | | Merge "Require a DiffConfig when creating a FollowFilter"Shawn Pearce2013-05-051-1/+4
|\ \ \
| * | | Require a DiffConfig when creating a FollowFilterDave Borowitz2013-05-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The various rename detection options are an inherent part of the filter, similar to the path being followed. This fixes a potential NPE when a RevWalk with a FollowFilter is created without a Repository, since the old code path tried to get the DiffConfig from the RevWalk's possibly-missing repository. Change-Id: Idb273d5a92849b42935ac14eed73b796b80aad50
* | | | Extend the FS class for Java7Robin Rosenberg2013-05-046-1/+61
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most important difference is that in Java7 we have symbolic links and for most operations in the work tree we want to operate on the link itself rather than the link target, which the old File methods generally do. We also add support for the hidden attribute, which only makes sense on Windows and exists, just since there are claims that Files.exists is faster the File.exists. A new bundle is only activated when run with a Java7 execution environment. It is implemented as a fragment. Tycho currently has no way to conditionally include optional features based on the java version used to run the build, this means with this change the jgit packaging build always needs to be run using java 7. Change-Id: I3d6580d6fa7b22f60d7e54ab236898ed44954ffd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | TagCommand should be able to create unannotated tags tooRobin Rosenberg2013-05-031-1/+13
| | | | | | | | | | | | | | | | | | | | | Using the low level API's is just too cumbersome. Change-Id: Id5b9f560ee095d6db0b2ea5b26aef3e53021626e Signed-off-by: Robin Stocker <robin@nibor.org>
* | | Add test for RefUpdate delete without HEADRobin Stocker2013-05-031-1/+16
| | | | | | | | | | | | | | | Bug: 406722 Change-Id: I555fb366ee64d885de2a71a67cf00833f4c62561
* | | Update tags on fetch if --tags or tag refspec specifiedRobin Stocker2013-05-011-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When either --tags or a tag ref is explicitly specified on fetch, C Git updates existing local tags if they are different. Before this change, JGit returned REJECTED in such a case. Now it updates it and returns FORCED. Example: % mkdir a % cd a % git init -q % touch test.txt % git add test.txt % git commit -q -m 'Initial' % git tag v1 % cd .. % git clone -q a b % cd a % echo Test > test.txt % git commit -q -a -m 'Second' % git tag -f v1 Updated tag 'v1' (was bc85c08) % cd ../b % git fetch --tags - [tag update] v1 -> v1 Bug: 388095 Change-Id: I5d5494c2ad1a2cdb8e9e614d3de445289734edfe
* | | Only fetch tags that do not exist locally with auto-followRobin Stocker2013-05-011-12/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corresponds to what C Git does, quoting from the fetch man page: This is done by first fetching from the remote using the given <refspec>s, and if the repository has objects that are pointed by remote tags that it does not yet have, then fetch those missing tags. Before, JGit would also fetch tags that exist locally but point to a different object, resulting in REJECTED results for these. Also add some test cases to cover more cases. Bug: 388095 Change-Id: Ib03d2d82e9c4b60179d626cfd5174be1da6388b2 Also-by: Stefan Lay <stefan.lay@sap.com>
* | | Abort before delete in FileUtils.delete EMPTY_DIRECTORIES_ONLY|RECURSIVERobin Stocker2013-04-291-1/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the order in which items are traversed for RECURSIVE, an empty directory may come first before detecting that there is a file and aborting. This fixes it by traversing files first. Bug: 405558 Change-Id: I638b7da58e33ffeb0fee172b96f4c823943d29e9 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Make the Reflog a public API again"Robin Rosenberg2013-04-278-37/+36
|\ \ \ | |/ / |/| |
| * | Make the Reflog a public API againRobin Rosenberg2013-04-268-37/+36
| | | | | | | | | | | | Change-Id: I8ced7098da5b345fd9af2fdfafd1ef6a44ccee0d
* | | Revert "Add tests for FileUtils.delete and EMPTY_DIREECTORIES_ONLY"Shawn Pearce2013-04-191-85/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7aa54967a26cb027fe390ad1c624ebb30f9ac6d5. The unit test dependend upon the specific order of names that listFiles() returned members in. The order is completely undefined and may differ even on different versions of Linux based systems. A proper unit test for this code would have considered both cases, where the deletion function was able to remove an empty subdirectory, or fail to remove a subdirectory because a file was still present within. This is not such a test. Change-Id: Ib0a706fea01e4b1ed8c8e859247d247a1279b4bc
* | | IndexDiff: Provide stage state for conflicting entriesRobin Stocker2013-04-191-0/+48
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Adds a new method getConflictingStageStates() which returns a Map<String, StageState> (path to stage state). StageState is an enum for all possible stage combinations (BOTH_DELETED, ADDED_BY_US, ...). This can be used to implement the conflict text for unmerged paths in output of "git status" or in EGit for decorations/hints. Bug: 403697 Change-Id: Ib461640a43111b7df4a0debe92ff69b82171329c Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Merge "A deleted work tree file is not a conflict when merge wants to delete it"Robin Rosenberg2013-04-191-0/+15
|\ \
| * | A deleted work tree file is not a conflict when merge wants to delete itRobin Rosenberg2013-04-081-0/+15
| |/ | | | | | | | | Bug: 405199 Change-Id: I4b2ef3dc432d2fad8a6fabd1c8aec407b5c8c5ac Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Merge "Untracked files should not be included in stash"Robin Rosenberg2013-04-191-0/+1
|\ \
| * | Untracked files should not be included in stashRobin Rosenberg2013-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The previous code stashed untracked files and left them in the work tree. Bug: 403282 Change-Id: I71727addb2b55fb8e409cae2b6af8138b1ff7ef1
* | | Do not export package org.eclipse.jgit from jgit testsMatthias Sohn2013-04-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3344b93c erroneously exported the package org.eclipse.jgit.lib from the org.eclipse.jgit.test bundle which made this a split package since the bundle org.eclipse.jgit exports the same package. Split packages are evil in general and most probably caused the build cycle errors observed recently when importing the jgit projects in Eclipse [1]. [1] http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02012.html Change-Id: I89919e56b928acdbff0b90e3919808025a8562c6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Remove some unnecessary dependencies on FileRepostoryRobin Rosenberg2013-04-189-35/+27
| | | | | | | | | | | | | | | Change-Id: Ib6ee3a2874a7e2240aa68f4ac32d00c4d1fab5ae Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | | Merge "Remove unused dependencies"Robin Rosenberg2013-04-181-3/+1
|\ \ \