summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Replace "a." with "a-" in unit testsShawn Pearce2014-12-188-29/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows does not like naming files "a.". The trailing "." may be dropped by the filesystem, which is confusing. Even though these tests currently do not write to disk, future tests like them might. Replace "." with "-", which has the same sorting properties that were desirable about ".", but does not have the same limitations. Change-Id: Ie5b7594bf5e79828d1341883c73ddb70123d5055
| | * Deprecate TemporaryBuffer.LocalFile without parent directoryShawn Pearce2014-11-252-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encourage callers to explicitly name a directory to hold any overflow data. Call sites have more information about what is going into the buffer and how it should be protected at the filesystem level than just throwing content to the system wide temporary directory. Callers that still really don't care (or need to care) can pass null for the File argument to have the system directory used. Change-Id: I89009bbee49d3850d42cd82c2c462e51043acda0
| | * DirCache: Buffer TREE extension to $GIT_DIRShawn Pearce2014-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase the in-memory buffer for the TREE extension to 5 MiB, and overflow to $GIT_DIR instead of /tmp. Using a larger buffer reduces the chances a repository will overflow and need to spool the extension to disk. Using $GIT_DIR allows the TREE extension contents to have the same file system protections as the final $GIT_DIR/index. Wrap the entire thing in a try/finally to ensure the temp file is deleted from disk after the block has finished using it. To avoid dangling NFS files, LocalFile.destroy() does close the local file before deleting it. Change-Id: I8f871181a4689e3ebf0cdd4fd1769333cf7546c3
| * | Prepare 3.5.3-SNAPSHOT buildsMatthias Sohn2014-11-122-38/+38
| | | | | | | | | | | | | | | Change-Id: Ia37eb66a0deaf6e86a726b1b12eaea25416d4a36 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.5.2.201411120430-rv3.5.2.201411120430-rMatthias Sohn2014-11-122-2/+2
| | | | | | | | | | | | | | | Change-Id: I217d25ee712cbde52bc9319ef1dd15d2f571d37a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 3.5.2-SNAPSHOT buildsMatthias Sohn2014-10-142-38/+38
| | | | | | | | | | | | | | | Change-Id: Ib2ccdebe80bad0b09d2d31889a3ab89d77e341f6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.5.1.201410131835-rv3.5.1.201410131835-rMatthias Sohn2014-10-142-2/+2
| | | | | | | | | | | | | | | Change-Id: I37e049c8e81f963cfb7c17f1af91fd4245766aee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Support the new repository layout for submodulesChristian Halstrick2014-12-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When updating a submodule (e.g. during recursive clone) the repository for the submodule should be located at <gitdir>/modules/<submodule-path> whereas the working tree of the submodule should be located at <working-tree>/<submodule-path> (<gitdir> and <working-tree> are associated to the containing repository). Since CloneCommand has learned about specifying a separate gitdir this is easy to implement in SubmoduleUpdateCommand. Change-Id: I9b56a3dfa50f97f6975c2bb7c97b36296f331b64
* | | Allow explicit configuration of git directory in CloneCommandChristian Halstrick2014-12-151-0/+50
| | | | | | | | | | | | | | | | | | | | | This feature is needed to support the new submodule layout where the .git folder of the submodules is under .git/modules/<submodule>. Change-Id: If5f13426cfd09b7677e23478e9700c8c25a6dae5
* | | Allow explicit configuration of git directory in InitCommandChristian Halstrick2014-12-151-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 tests on windows by closing reposChristian Halstrick2014-12-128-238/+247
| | | | | | | | | | | | | | | | | | | | | Without explicitly closing repos we can't delete the test repositories on windows. Change-Id: Id5fa17bd764cbf28703c2f21639d7e969289c2d6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Fix DirCacheCheckout to set correct file length if ↵Christian Halstrick2014-12-121-1/+47
|\ \ \ | | | | | | | | | | | | core.autocrlf=true" into stable-3.6
| * | | Fix DirCacheCheckout to set correct file length if core.autocrlf=trueMatthias Sohn2014-12-111-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To update the file length stat we need to use the length of the temporary file since it's not yet renamed to the target file name here. The incorrect file length stat update was introduced in a606dc363d0f6b09e4527cca6b645d3cb1ec407d. Bug: 453962 Change-Id: I715c048227553efae6f8f6b6878c0f04f2609d9c Also-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> Also-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | CheckoutCommand: Fix checking out ours/theirs when no base stage existsRobin Stocker2014-12-101-0/+34
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | In case of an add/add conflict, no base stage exists. The previous implementation would skip over the entries because the condition expected the base stage to always exist. Change-Id: Ie2b3685d958c09b241991b74e6177401e8a1ebc9 Signed-off-by: Robin Stocker <robin@nibor.org>
* | | Consider parent rules if ignore rule is negatedAndrey Loskutov2014-11-291-2/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change tries to make jgit behave more like native CLI git regarding the negation rules. According to [1] "... prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again." Negating the pattern should not automatically make the file *not ignored* - other pattern rules have to be considered too. The fix adds test cases for both bugs 448094 and 407475. [1] https://www.kernel.org/pub/software/scm/git/docs/gitignore.html Bug: 448094 Bug: 407475 Change-Id: I322954200dd3c683e3d8f4adc48506eb99e56ae1 Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Deprecate checkoutEntry variant that accepts FileShawn Pearce2014-11-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Entries should only be written to the working tree managed by the Repository. Simplify callers by passing only the entry and computing the work tree location inside of the checkoutEntry method. Change-Id: I574e41280d0407f1853fda12f4bd0d30f75d74e7
* | | Deprecate checkoutEntry without ObjectReaderShawn Pearce2014-11-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Callers should manage the ObjectReader, as this allows the JGit library to cache context relevant information across files checked out at the same time. If the caller only has one file to checkout, it should still explicitly manage the life span of the ObjectReader. Change-Id: Ib57fba6cb4b774ccff8c416ef4d32e2b390f16a9
* | | Don't use java.util.regex for two simple wildcard casesAndrey Loskutov2014-11-183-21/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To improve ignore parser performance we can avoid using java.util.regex code on simple wildcard patterns with leading or trailing asterisk. As those patterns represent a majority of ignore rules, the index diff performance can be drastically increased on huge repository with lot of ignore rules. Bug: 450466 Change-Id: I80428441cc8d5de5468813f841d89322413eed8b Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix variable name and error message for sideband testingStefan Beller2014-11-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Actually the test only allows a range from [1,255], so let's name the variable so. Change-Id: Iecdb8149b83389c67e3cd2f64f4a654c175475be Signed-off-by: Stefan Beller <sbeller@google.com>
* | | Expand wildcard imports to specfic classesShawn Pearce2014-11-107-27/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | JGit style is to import exactly the classes required, and never to use "import foo.*" as the foo package could add new classes in the future which are conflicting/confusing with the imports already used by a source file. Change-Id: I5693408c777e5843ec65fff1163d5d717849fa34
* | | Fix possible NPE in IndexDiff when not all submodules are clonedChristian Halstrick2014-11-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The latest changes to IndexDiff just assumed that all configured submodules are allways cloned. If a configured submodule did not exist an exception was thrown. This is fixed by this commit. Bug: 450567 Change-Id: Iabe3b196d998c19483082e5720038ebddaeb1890
* | | Make sure checkout doesn't report conflicts on ignored pathsChristian Halstrick2014-11-061-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a situation where a certain path was ignored but a working tree file with this path existed jgit didn't allow to checkout a branch which didn't ignore this path but contained different content. JGit considered this to be a checkout conflict to prevent overwriting the file in the working tree and raised an error. This commit fixes this by ensuring that ignored dirty working tree files don't lead to a checkout conflict. Bug: 450169 Change-Id: I90288d314ffac73c24a9c70a5181f8243bd4679a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Support for Submodule configuration submodule.<name>.ignoreChristian Halstrick2014-11-031-0/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For each submodule native git allows to configure which modifications to submodules should be ignored by the status command. It is possible to ignore "none", "all", "dirty", "untracked" [1]. This configuration is now supported by IndexDiff. The StatusCommand offers the possibility to specify this mode. [1] http://git-scm.com/docs/gitmodules Change-Id: Ifd81d574a680f9b4152945ba70f8ec4af4f452c9
* | | Reimplementation of ignore rule parserAndrey Loskutov2014-10-276-5/+1918
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current IgnoreRule/FileNameMatcher implementation scales not well with huge repositories - it is both slow and memory expensive while parsing glob expressions (bug 440732). Addtitionally, the "double star" pattern (/**/) is not understood by the old parser (bug 416348). The proposed implementation is a complete clean room rewrite of the gitignore parser, aiming to add missing double star pattern support and improve the performance and memory consumption. The glob expressions from .gitignore rules are converted to Java regular expressions (java.util.regex.Pattern). java.util.regex.Pattern code can evaluate expression from gitignore rules considerable faster (and with less memory consumption) as the old FileNameMatcher implementation. CQ: 8828 Bug: 416348 Bug: 440732 Change-Id: Ibefb930381f2f16eddb9947e592752f8ae2b76e1 Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Initialize 'pathLen' field also for empty directories"Robin Stocker2014-10-231-0/+37
|\ \ \
| * | | Initialize 'pathLen' field also for empty directoriesAndrey Loskutov2014-10-231-0/+37
| | | | | | | | | | | | | | | | | | | | Bug: 445363 Change-Id: Ia8428af84fb61ba0d572374a19e8e8c55b138a63 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
* | | | BundleWriter: Support including HEAD in bundleRobin Stocker2014-10-191-10/+17
|/ / / | | | | | | | | | | | | | | | Bug: 446813 Change-Id: Ide64aec2a995dd7ff6c1325c3ada242a4eb4565e Signed-off-by: Robin Stocker <robin@nibor.org>
* | | Fix ResetCommand to default to mixed resetMatthias Sohn2014-10-131-0/+15
| | | | | | | | | | | | | | | | | | | | | ResetCommand threw an NPE if neither mode nor path was defined. Instead it should default to a mixed reset like native git does. Change-Id: I455902394f9e7b0c7afae42381f34838f7f2a138 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge branch 'stable-3.5'Matthias Sohn2014-09-261-0/+29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.5: Prepare 3.5.1-SNAPSHOT builds JGit v3.5.0.201409260305-r Fix PackWriterBitmapWalker handling non-existing uninteresting objects Enable maven site generation for jgit Generate javadocs as part of Maven site project reports Compare API changes with clirr against 3.4.1 [cli] Use chaining credentials provider to enable .netrc Add chaining credentials provider [Java 8] Configure doclint to accept missing descriptions Do not use .netrc implicitly if no CredentialsProvider was set Prepare post 3.5.0-rc1 builds JGit 3.5.0.201409071800-rc1 Fix the ls-remote command when there is no local repo Change-Id: Iaa4485cac6ff9c7917380e89e12e416e0f52a557 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare 3.5.1-SNAPSHOT buildsMatthias Sohn2014-09-262-38/+38
| | | | | | | | | | | | | | | Change-Id: Ibf89f996c9d9a7e431ee09261987bb76246de441 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v3.5.0.201409260305-rv3.5.0.201409260305-rMatthias Sohn2014-09-262-2/+2
| | | | | | | | | | | | | | | Change-Id: Ibf382bda3dcbb4b70829b1dd3a8abfd07bc4879e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Fix PackWriterBitmapWalker handling non-existing uninteresting objectsChristian Halstrick2014-09-251-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When writing new packs it should be allowed to specify objects as "have" (objects which should not be included in the pack) which do not exist in the local repository. This works with the traditional PackWriter, but when PackWriter was working on a repository with bitmap indexes and used PackWriterBitmapWalker then this feature was broken. Non-existing "have" objects lead to MissingObjectExceptions. That broke push and Gerrit replication. When the replication target had branches unknown to the replication source then the source repository wanted to build pack files where "have" included branch-tips which were unknown in the source repository. Bug: 427107 Change-Id: I6b6598a1ec49af68aa77ea6f1f06e827982ea4ac Also-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Prepare post 3.5.0-rc1 buildsMatthias Sohn2014-09-082-2/+2
| | | | | | | | | | | | Change-Id: Id9e01b867bff0ed10e887c15a12e5399b788b68e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit 3.5.0.201409071800-rc1v3.5.0.201409071800-rc1Matthias Sohn2014-09-072-2/+2
| | | | | | | | | | | | | | | Change-Id: I59e5e2492820da111df1837fbf3649a2ae03841c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Add "aggressive" option to GCChristian Halstrick2014-09-191-13/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit should offer the possibility to do a garbage collection in "aggressive" mode. In this mode garbage collection more aggressively optimize the repository at the expense of taking much more time. Technically a aggressive mode garbage collection differs from a non-aggressive one by: - not reusing packed objects found in old packs. Recompress every object - the configuration pack.window is set to 250 (the default is 10) - the configuration pack.depths is set to 250 (the default is 50) The associated classes in org.eclipse.jgit.api and the command line command in org.eclipse.jgit.pgm expose this new option. The configuration parameters gc.aggressiveDepth and gc.aggressiveWindow have been introduced to configure this feature. Bug: 444332 Change-Id: I024101f2810acf6be13ce144c9893d98f5c4ae76
* | | Prepare 3.6.0-SNAPSHOT buildsMatthias Sohn2014-09-052-38/+38
|/ / | | | | | | | | Change-Id: I2d8c3768998c0cfc8d02d11009bc5b7ed1d75778 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | PlotCommitList: Close plot lanes at root commitsKonrad Kügler2014-09-021-0/+38
| | | | | | | | | | Bug: 443006 Change-Id: I40b1eb044fa2d9e6c5d4b956c17e32ca6c1bd39f Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
* | Handle -m option for Merge commandAxel Richard2014-08-301-1/+64
| | | | | | | | | | | | | | | | | | Set the commit message to be used for the merge commit (in case one is created) Bug: 442886 Change-Id: Ie5ecc13822faa366f00b3daa07f74c8441cae195 Signed-off-by: Axel Richard <axel.richard@obeo.fr> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Let ObjectWalk.markUninteresting also mark the root tree asSaša Živkov2014-08-281-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uninteresting Using the ObjectWalk and marking a commit as uninteresting didn't mark its root tree as uninteresting. This caused the "missing tree ..." error in Gerrit under special circumstances. For example, if the patch-set 2 changes only the commit message then the patch-set 1 and patch-set 2 share the same root-tree: ps1 -> o o <- ps2 \ / o root-tree The transported pack will contain the ps2 commit but not the root-tree object. When using the BaseReceivePack.setCheckReferencedObjectsAreReachable JGit will check the reachability of all referenced objects not provided in the transported pack. Since the ps1 was advertised it will properly be marked as uninteresting. However, the root-tree was reachable because the ObjectWalk.markUninteresting missed to mark it as uninteresting. JGit was then rejecting the pack with the "missing tree ..." exception. Gerrit-issue: https://code.google.com/p/gerrit/issues/detail?id=1582 Change-Id: Iff2de8810f14ca304e6655fc8debeb8f3e20712b Signed-off-by: Saša Živkov <sasa.zivkov@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Strip "<", ">", and "\n" from name/email in UserConfigRobin Stocker2014-08-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | This matches what C Git does, see "stripped" in `man git-commit-tree`. It also fixes the bug of the user where an user.email like "<>" would show up as "<<>>" in EGit. Bug: 439844 Change-Id: I567a3c620e191ce9d37d318417e63cb5d4483419 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Support remote aliases in repo manifest.Yuxuan 'fishy' Wang2014-08-181-0/+24
| | | | | | | | | | Change-Id: Icbe5761b9d8a4ae5305bfe45b2d042f214156fc8 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | Support non-default remotes in project tag.Yuxuan 'fishy' Wang2014-08-181-0/+30
| | | | | | | | | | Change-Id: I3c730a1ce379d142d3ed81dda4a73f86f1f9c3eb Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | Add tests for checking out tags with CheckoutCommandRobin Stocker2014-08-171-3/+29
| | | | | | | | | | Change-Id: Ifec3ac59264c91e154b832fdd907736faf8a8412 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Add support to <include> tag in repo manifest xml.Yuxuan 'fishy' Wang2014-08-131-0/+40
| | | | | | | | | | Change-Id: I32d468f92e24701ea680435bf3417e3850857303 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
* | Revert "Add a method to DfsOutputStream to read as an InputStream"Shawn Pearce2014-08-131-150/+0
| | | | | | | | | | | | | | | | | | | | | | This reverts commit b646578d89513c5db30151f0b865c7335c88d682. openInputStream() is never used in JGit, nor is it used by any known working DFS implementation. The method was added as a utility for reading back from a DfsInserter, but the final implementation of that feature does not requrire this method. Change-Id: I075ad95e40af49c92b554480f8993ef5658f7684
* | Add a method to ObjectInserter to read back inserted objectsDave Borowitz2014-08-131-0/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the DFS implementation, flushing an inserter writes a new pack to the storage system and is potentially very slow, but was the only way to ensure previously-inserted objects were available. For some tasks, like performing a series of three-way merges, the total size of all inserted objects may be small enough to avoid flushing the in-memory buffered data. DfsOutputStream already provides a read method to read back from the not-yet-flushed data, so use this to provide an ObjectReader in the DFS case. In the file-backed case, objects are written out loosely on the fly, so the implementation can just return the existing WindowCursor. Change-Id: I454fdfb88f4d215e31b7da2b2a069853b197b3dd
* | Fix CheckoutCommand not setting up trackingRobin Stocker2014-08-052-17/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing on the start point as is to CreateBranchCommand, the resolved ObjectId was used. Given this, CreateBranchCommand did not set up tracking. This also fixes CreateBranchCommand with setStartPoint(null) to use HEAD (instead of NPEing), as documented in the Javadoc. Bug: 441153 Change-Id: I5ed82b4a4b4a32a81a7fa2854636b921bcb3d471 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Merge "Add isRebase to API of BranchConfig"Robin Rosenberg2014-08-031-0/+16
|\ \
| * | Add isRebase to API of BranchConfigRobin Stocker2014-08-031-0/+16
| | | | | | | | | | | | | | | Change-Id: I9819f49410e30d32c2157db0556a0dd6a0bcc5a4 Signed-off-by: Robin Stocker <robin@nibor.org>
* | | NetRC parser and credentials provider.Alexey Kuznetsov2014-08-031-0/+191
|/ / | | | | | | | | | | | | | | | | Adds default git command line behaviour of reading credentials for https connections from .netrc file. Bug: 428229 Change-Id: I88699ca5da6a20bdeaed24b7e3899cc1022b8e7c Signed-off-by: Alexey Kuznetsov <axet@me.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>