summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Prepare 3.3.2-SNAPSHOT buildsMatthias Sohn2014-03-252-37/+37
| | | | | Change-Id: I48271980a258acd0ada7c418b24c61c1bf0a0cd2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.3.1.201403241930-rv3.3.1.201403241930-rMatthias Sohn2014-03-252-2/+2
| | | | | Change-Id: Ib317903898095d205f0b6ed4cead62ff6eabd894 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare 3.3.1-SNAPSHOT buildsMatthias Sohn2014-03-052-37/+37
| | | | Change-Id: If15560f2731e54dbf9db88d8a308b4c25ce27e8e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.3.0.201403021825-rv3.3.0.201403021825-rMatthias Sohn2014-03-032-2/+2
| | | | | Change-Id: Iaf3da455f7d6f691617299e881154ff8185a9d46 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix merge/cherry-picking in CRLF modeRobin Rosenberg2014-03-021-0/+32
| | | | | | | This fixes a case where we have CRLF in the repo but LF in the worktree and are in autocrlf mode. Change-Id: I0388270c1cf0fd22dfd513bcaa404eb97268d39d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare post 3.3.0RC1 buildsMatthias Sohn2014-02-202-2/+2
| | | | | Change-Id: I0d808f8733a490b75bbcaacedb4b095e05fab32e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v3.3.0.201402191814-rc1v3.3.0.201402191814-rc1Matthias Sohn2014-02-202-2/+2
| | | | | Change-Id: Ida3a0417ae646ce37214153f49a85de2be3dd4fd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [findBugs] Don't ignore exceptional return value of File.mkdir()Matthias Sohn2014-02-181-1/+2
| | | | Change-Id: Ic4c61472412aa158a355bb444805cde8c5d2833a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [findBugs] Don't rely on default encodingMatthias Sohn2014-02-181-1/+1
| | | | Change-Id: I9be2ffe95e8d716326ba63b67672741ac316f9a5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* [findBugs] Don't call toString() on a stringMatthias Sohn2014-02-181-1/+1
| | | | Change-Id: I0b91ffd473e2f14623ddf409e4f0f342c8941e42 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix diff header on renamed or copied filesShawn Pearce2014-02-181-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When git-core renames or copies a file and the mode differs the header shows the mode change first, then the rename or copy data: diff --git a/COPYING b/LICENSE old mode 100644 new mode 100755 similarity index 92% rename from COPYING rename to LICENSE index d645695..54863be --- a/COPYING +++ b/LICENSE @@ -56,20 +56,6 @@ JGit relies on this ordering inside of FileHeader. Parsing "new file mode NNN" after "copy from/to" or "rename from/to" resets the change type to be ADD, losing the COPIED or RENAMED status and old path. This fixes a 4 year old bug in Gerrit Code Review that prevents opening a file for review if the file was copied from another file, modified in this change, and the mode was updated (e.g. execute bit was added). Change-Id: If4c9ecd61ef0ca8e3e1ea857301f7b5c948efb96 [ms: added test case] Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Introduce an abstraction for HTTP connectionsChristian Halstrick2014-02-182-12/+13
| | | | | | | | | | | | | | | | | | | | | | Previously all HTTP communication was done with the help of java.net.HttpUrlConnection. In order to make JGit usable in environments where the direct usage of such connections is not allowed but where the environment provides other means to get network connections an abstraction for connections is introduced. The idea is that new implementations of this interface will be introduced which will not use java.net.HttpUrlConnection but use e.g. org.apache.client.http.HttpClient to provide network connections. One example: certain cloud infrastructures don't allow that components in the cloud communicate directly with HttpUrlConnection. Instead they provide services where a component can ask for a connection (given a symbolic name for the destination) and where the infrastructure returns a preconfigured org.apache.http.client.HttpClient. In order to allow JGit to be running in such environments we need the abstraction introduced in this commit. Change-Id: I3b06629f90a118bd284e55bb3f6465fe7d10463d Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Allow programmatic remote configuration for PullCommandMatthias Sohn2014-02-141-0/+65
| | | | | | | | Also imply remoteBranchName to match current branch name if it wasn't configured in branch configuration. Bug: 424812 Change-Id: Id852cedaefb2a537b6aa3c330b9861efad052f11 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use branch.<x>.mergeoptions and merge.ff as defaults for mergingKonrad Kügler2014-02-141-0/+47
| | | | | | | | | Read options that control squashing, whether or not to commit the merge and regarding fast forwarding from the configuration and use them if no explicit values for these options have been provided to MergeCommand. Change-Id: Ifdaed4b5e4adc142657c03c8e78b709a99eeddbd Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Non-Fast-Forward Ref-Updates: Omit isMergedInto() callsRoberto Tyley2014-02-132-1/+21
| | | | | | | | | | | | When the caller specifies to JGit in advance that a ref-update is a non-fast-forward update, and that those are permitted, we should never need to call the potentially expensive isMergedInto() check. Re-checking that the older commit is /not/ reachable from the newer is superfluous. http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02258.html Change-Id: I4bbf593de4dcea6b6f082881c1a33cb3a6a7fb89 Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
* Initialise ReceiveCommand status to NOT_ATTEMPTED for all constructorsRoberto Tyley2014-02-131-3/+1
| | | | | | | | | | | | | Formerly the 4-arg constructor did not do this, which was unfortunate as that constructor's the only way for an external user of JGit to set the /type/ of the ref-update - which you might want to do to indicate that the update is expected to be a UPDATE_NONFASTFORWARD, and thus does not require expensive isMergedInto() calculations: http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02258.html Change-Id: I84c5e4927131e105bed93e31a62da6367c78de32 Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
* Use fileAttributes to get more attributes in one goRobin Rosenberg2014-02-121-1/+1
| | | | | | | | | On Windows the length reported by FileAttributes is the size of the target file (a bug, I guess) rather than the link, so we read the linke and look at the length of the link instead. Bug: 353771 Change-Id: I834b06d0447f84379612b8c9190fa77093617595 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix RevWalkUtils.findBranchesReachableFrom not finding some branchesRobin Stocker2014-02-111-0/+128
| | | | | | | | | | | | | | | | | | | | | | | The "cut off" optimization causes it to not include branches that contain the specified commit but happen to share commits with a branch that does not contain the commit. An example: -B foo \ -A---C master findBranchesReachableFrom for commit A with both branches as input may not return master (depending on the order of the input). The reason is that A is not contained in foo, and therefore the old code would put B in the cutOff set. When then walking the master commits and B is checked, it is found in the cutOff set and the walk is aborted, causing master not to be returned even though it should. Bug: 425674 Change-Id: I2c0c406ce5fcc9a03538b483473af930d4895d30 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add symlink support to JGitRobin Rosenberg2014-02-101-1/+4
| | | | | | | | | | | | | | | | | | | | The change includes comparing symbolic links between disk and index, adding symbolic links to the index, creating/modifying links on checkout. The behavior is controlled by the core.symlinks setting, just as C Git does. When a new repository is created core.symlinks will be set depending on the capabilities of the operating system and Java runtime. If core.symlinks is set to true, the assumption is that symlinks are supported, which may result in runtime errors if this turns out not to be the case. Measuring the cost of jgit status on a repository with ~70000 files, of which ~30000 are tracked reveals a penalty of about 10% for using the Java7 (really NIO2) support module. Bug: 354367 Change-Id: I12f0fdd9d26212324a586896ef7eb1f6ff89c39c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Failing to delete a directory with untracked content is actually okRobin Rosenberg2014-02-101-5/+4
| | | | | | | We had a test, but it was wrong. Bug: 424630 Change-Id: I926e0954c8623a323a50fe8be3ebe5e0ac6944c8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Ban dangerous ref names in WindowsRobin Rosenberg2014-02-051-0/+23
| | | | | | | Bug: 423551 Change-Id: I3e71ef1b4a8181f46d2902c9169859f150cd6ad0 Also-By: Robin Stocker <robin@nibor.org> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Reset internal state canonical length in WorkingTreeIterator when movingRobin Rosenberg2014-02-031-1/+14
| | | | | Bug: 426514 Change-Id: Ifb75a4fa12291aeeece3dda129a65f0c1fd5e0eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix for core.autocrlf=input resulting in modified fileRobin Rosenberg2014-02-022-3/+40
| | | | | | | | | | | This version does not attempt to unsmudge, unlike the first attempt in Idafad150553df14827eccfde2e3b95760e16a8b6. Bug: 372834 Change-Id: I9300e735cb16d6208e1df963abb1ff69f688155d Also-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Robin Stocker <robin@nibor.org>
* Do not report ignored directories as untrackedMatthias Sohn2014-01-191-0/+47
| | | | | Change-Id: I7e3f6b9fb1ac4b99d2cc9a78c63aad86f4fa5744 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add git checkout --orphan implementationSATO taichi2014-01-171-0/+96
| | | | Change-Id: I7bb583674641efed210d3cd5b86af27d7bb48e97 Signed-off-by: SATO taichi <ryushi@gmail.com>
* Fix fast forward rebase with rebase.autostash=trueStefan Lay2014-01-151-0/+39
| | | | | | | | | The folder .git/rebase-merge was not removed in this case. The repository was then still in rebase state, but neither abort nor continue worked. Bug: 425742 Change-Id: I43cea6c9e5f3cef9d6b15643722fddecb40632d9
* Upgrade javaewah to version 0.7.9Colby Ranger2014-01-133-3/+3
| | | | | | | Package was renamed, so I had to update the imports. Also, I verified bitmap serialization was still compatible. Change-Id: I161ad3875b963b56001beab477ef8d072accee4f
* Merge branch 'stable-3.2'Matthias Sohn2013-12-132-37/+232
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.2: Canonicalize worktree path in BaseRepositoryBuilder if set via config Add missing @since tags for new public methods in Config Don't use API exception in RebaseTodoLine Fix aborting rebase with detached head Add recursive variant of Config.getNames() methods Prepare post 3.2.0-m3 builds JGit v3.2.0.201311130903-m3 Change-Id: Iad6e284e0fe2c7950f156372b334e47ebd82f3f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Don't use API exception in RebaseTodoLineChristian Halstrick2013-12-111-36/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | This came up while testing the proposed buck build for jgit. With buck we can introduce smaller modules to allow for more concurrency during build and to better control inner structure of jgit. Trying to put the porcelain API into a different module than lower level implementation classes failed since RebaseTodoLine used a porcelain API exception causing a dependency cycle on the proposed modules. Using an exception defined on the same abstraction level fixes this problem. Change-Id: I26a5353e1a8fc23e67d8ce61309bd964f7665bcb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
| * Merge "Fix aborting rebase with detached head" into stable-3.2Robin Rosenberg2013-12-101-0/+63
| |\
| | * Fix aborting rebase with detached headStefan Lay2013-12-101-0/+63
| | | | | | | | | | | | | | | Bug: 423670 Change-Id: Ia6052867f85d4974c4f60ee5a6c820501e8d2427
| * | Add recursive variant of Config.getNames() methodsMatthias Sohn2013-12-061-1/+55
| |/ | | | | | | | | | | | | | | | | | | | | | | | | These methods allow to find all configuration entry names for a given section or section/subsection searching recursively through all base configurations of the given configuration. These methods are needed to calculate the names for the effective configuration of a git repository which combines the configuration entry names found in the repository, global and system configuration files Bug: 396659 Change-Id: Ie3731b5e877f8686aadad3f1a46b2e583ad3b7c6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / Prepare 3.3.0-SNAPSHOT buildsMatthias Sohn2013-12-052-36/+36
|/ | | | | Change-Id: I7c7e7c1beec0c5d15b96c14c73ce93e3f09855c8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Implement rebase.autostashStefan Lay2013-12-041-0/+137
| | | | | | | This feature was introduced in native git with version 1.8.4. Bug: 422951 Change-Id: I42f194174d64d7ada6631e2156c2a7bf93b5e91c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "More helpful InvalidPathException messages (include reason)"Christian Halstrick2013-12-041-1/+1
|\
| * More helpful InvalidPathException messages (include reason)Robin Stocker2013-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | Instead of just a generic "Invalid path: $path", add a reason for the cases where it's not obvious what the problem is (e.g. "aux" being reserved on Windows). Bug: 413915 Change-Id: Ia6436bd2560e4f049c92d9aac907cb87348605e0 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Fix IgnoreRule#isMatch returning wrong result due to missing resetRobin Stocker2013-12-031-0/+12
|/ | | | | | | | | | The matcher has to be reset before using it, as was already done in the other cases. Bug: 423039 Change-Id: I87abaa7ad7f0aac8651db6e88d41427cacb4d776 Also-by: Ondrej Vrabec <ovrabec@netbeans.org> Signed-off-by: Robin Stocker <robin@nibor.org>
* Fix exception on conflicts with recursive mergeRobin Stocker2013-12-031-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are conflicts with a recursive merge, the conflicting paths are stored in unmergedPaths (field in ResolveMerger). Later, when the MergeResult is constructed in MergeCommand, getBaseCommit is called, which computes the merge base a second time. In case of RecursiveMerger, getBaseCommit merges the multiple merge bases into one. It does this not by creating a new ResolveMerger but instead calling mergeTrees. The problem with mergeTrees is that at the end, it checks if unmergedPaths is non-empty and returns false in that case. Because unmergedPaths was already non-empty because of the real merge, it thinks that there were conflicts when computing the merge base again, when there really were none. This can be fixed by storing the base commit when computing it and then returning that instead of computing it a second time. Note that another possible fix would be to just use a new ResolveMerger for merging the merge bases instead. This would also remove the need to remember the old value of dircache, inCore and workingTreeIterator (see RecursiveMerger#getBaseCommit). Bug: 419641 Change-Id: Ib2ebf4e177498c22a9098aa225e3cfcf16bbd958 Signed-off-by: Robin Stocker <robin@nibor.org>
* Do not allow non-ff-rebase if there are uncommitted changesStefan Lay2013-12-021-28/+152
| | | | | | | | | | | | | With this change jgit checks for uncommitted changes before a rebase is started. This is also done by native git. One reason is that an abort would override such changes. The check is skipped for a non-interactive rebase when it will result in a fast-forward. In this case there can be only checkout conflicts but no merge conflicts, so there cannot be an abort which overrides uncommitted changes. Bug: 422352 Change-Id: I1e0b59b2a4d80a686b67a6729e441924362b1236 Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix handling of file/folder conflicts during a checkoutChristian Halstrick2013-11-291-0/+25
| | | | | | | | | | | | | | | | | | | | JGit was not handling certain file/folder conflicts during a checkout correctly. This was reported by Axel Richard in http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02358.html. This commit fixes this problem. Still JGit behaves intentionally different than native git. If HEAD contains a tree, and workingtree, Index and Merge contain a file with same content ... then JGit allows a conflict free checkout of Merge. Native git always complains that it doesn't want to overwrite local changes. But there is no need to update the working tree because Index and Merge are already equal. A shell script which shows how native git behaves can be found here. https://gist.github.com/chalstrick/7694959#file-gistfile1-sh Change-Id: Ifd6a68974d61cd4fa23bc575f3a40773db66cafc Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* Fix applying stash on other commitStefan Lay2013-11-291-0/+87
| | | | | | | | Applying a stash on another commit failed because the merge base for the cherry-pick of the stashed index state was not corectly set. Bug: 422684 Change-Id: I9355352b2b9a7abefa3248ca3c17a9301177d0d6 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Break up GCTest to run in parallelShawn Pearce2013-11-2411-777/+1226
| | | | | | | | Separate some sections of the GC tests into different test classes. Individual classes permits running in parallel under Buck, reducing test latency if there are sufficient CPUs available. Change-Id: I5eb177f78efd4aa8ac857d0d8b1a1fd81ca07790
* Modify T0004_PackReaderTest to use existing packShawn Pearce2013-11-241-10/+10
| | | | | | | | Instead of making a new PackFile from a resource, lookup the existing PackFile that was already created by the base class SampleDataRepositoryTestCase. Change-Id: Ib5da18c832ae0cb29703706b99e99503f5cc819d
* Move SampleDataRepositoryTestCase to org.eclipse.jgit.testShawn Pearce2013-11-2416-15/+94
| | | | | | | | This class requires resources which are private to another bundle. Move the class next to its resources, removing an odd cross bundle dependency. Change-Id: I30d5568b09ea5fb3bd3bb60b602f149c0867f49a
* Cache SimpleDateFormat in GitDateParser per localeMatthias Sohn2013-11-233-18/+38
| | | | | | | | | | Otherwise switching to another locale yields wrong results when parsing date strings in GitDateParser. Since the MockSystemReader explicitly uses english locale the tests need to specify the locale to be used when parsing date strings. Bug: 420772 Change-Id: I313ef6b1e9ef3bfb43d929ce34712ebd21f2cd9c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix FIXUP error for blank lines in interactive rebaseStefan Lay2013-11-221-0/+38
| | | | | | | | Empty lines of discarded commit messages were added to the commit message because they were not commented out properly. Bug: 422246 Change-Id: I263e8a6b30a3392d8b4f09c0695505068a0a485d Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Fix parsing Rebase todo lines when commit message is missingStefan Lay2013-11-211-0/+13
| | | | | Bug: 422253 Change-Id: I9739b16c91d2df31a481360a712d3479a4eeee2e Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Add close() method to APIChristian Halstrick2013-11-201-0/+28
| | | | | | | | | | | The API in org.eclipse.jgit.api does allow to open repositories but it did not allow to close them. This commit fixes this and allows API users to close a repository without having to use lower-level classes. Bug: 420502 Change-Id: I866225cc8534ae5916113fa24eb1c7513fd4472e Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Don't delete .idx file if .pack file can't be deletedChristian Halstrick2013-11-131-0/+36
| | | | | | | | | | | | | | | | | | If during an garbage collection old packfiles are deleted it could happen that on certain platforms the index file can be deleted but the packfile can't be deleted (because someone locked the file). This led to repositories with packfiles without corresponding index files. Those zombie-packfiles potentially consume a lot of space on disk and it is never tried to delete them again. Try to avoid this situation by deleting packfiles first and don't try to delete the other files if we can't delete the packfile. This gives us the chance to delete the packfile during next GC. This commit only improves the situation - there is still the chance for orphan files during packfile deletion. We don't have an atomic delete of multiple files . Change-Id: I0a19ae630186f07d0cc7fe9df246fa1cedeca8f6
* [findBugs] Remove nonsense callMatthias Sohn2013-11-101-1/+0
| | | | | | Result of c.containsAll(c) is always true for any collection c. Change-Id: I853cbb44bdc03e2b54229bb9c36ae42e02dcc4d9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>