summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Always checkout master when it matches the advertised HEADKevin Sawicki2011-11-281-0/+16
| | | | | | | This parallels the CGit behavior of always using refs/heads/master when it matches the remote advertised HEAD commit. Change-Id: I5a5cd1516b58d116e334056aba1ef7990697ec30
* Adapt merge message to C Git for remote-tracking branchRobin Stocker2011-11-231-2/+2
| | | | | | | | | | | | | Commit 13931236b9ee2895a98ffdbdacbd0f895956d8a8 in C Git (2011-11-02) changed the message format: -Merge remote branch 'origin/foo' +Merge remote-tracking branch 'origin/foo' This change does the same in EGit to be consistent. Change-Id: I7d9c5afa95771dbfe6079b5f89a10b248fee0172 Signed-off-by: Robin Stocker <robin@nibor.org>
* Guard against null branch in PullCommandKevin Sawicki2011-11-221-0/+12
| | | | | | | | Throw a NoHeadException when Repository.getFullBranch returns null Bug: 351543 Change-Id: I666cd5b67781508a293ae553c6fe5c080c8f4d99 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Support adding all refs to LogCommandKevin Sawicki2011-11-221-0/+91
| | | | | Bug: 353310 Change-Id: Ifa2e7ed58c7f2bdfe3aafbd500b5a38c1f94c2ec Signed-off-by: Kevin Sawicki <kevin@github.com>
* maxObjectSizeLimit for receive-pack.Sasa Zivkov2011-11-221-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReceivePack (and PackParser) can be configured with the maxObjectSizeLimit in order to prevent users from pushing too large objects to Git. The limit check is applied to all object types although it is most likely that a BLOB will exceed the limit. In all cases the size of the object header is excluded from the object size which is checked against the limit as this is the size of which a BLOB object would take in the working tree when checked out as a file. When an object exceeds the maxObjectSizeLimit the receive-pack will abort immediately. Delta objects (both offset and ref delta) are also checked against the limit. However, for delta objects we will first check the size of the inflated delta block against the maxObjectSizeLimit and abort immediately if it exceeds the limit. In this case we even do not know the exact size of the resolved delta object but we assume it will be larger than the given maxObjectSizeLimit as delta is generally only chosen if the delta can copy more data from the base object than the delta needs to insert or needs to represent the copy ranges. Aborting early, in this case, avoids unnecessary inflating of the (huge) delta block. Unfortunately, it is too expensive (especially for a large delta) to compute SHA-1 of an object that causes the receive-pack to abort. This would decrease the value of this feature whose main purpose is to protect server resources from users pushing huge objects. Therefore we don't report the SHA-1 in the error message. Change-Id: I177ef24553faacda444ed5895e40ac8925ca0d1e Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing '' characters around quoted variablesKevin Sawicki2011-11-181-1/+1
| | | | | | | | Double ' characters are needed for variables to appear in single quotes. Variables surrounded with a s single ' will not be replaced when formatted Change-Id: I0182c1f679ba879ca19dd81bf46924f415dc6003 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Clean up tab usage in Directory/File conflict tableRobin Rosenberg2011-11-101-9/+9
| | | | | Change-Id: I394fc1ef714c8465cbd5af9c73338b9a324ad9c4 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Add detection of untracked folders to IndexDiffFilterJens Baumgart2011-11-101-0/+66
| | | | | | | | | | | | | | | Decorators need to know whether folders in the working tree contain only untracked files. This change enhances IndexDiffFilter to report such folders. This works only together with treewalks which operate in default traversal mode. For treewalks which process entries in postorder mode (files are walked before their parent folder is walked) this detection doesn't work. Bug: 359264 Change-Id: I9298d1e3ccac0aec8bbd4e8ac867bc06a5c89c9f Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* [blame] Fix blame following renames in non-toplevel directoriesCarsten Pfeiffer2011-11-102-11/+101
| | | | | | | | | | | Mark the treeWalk as recursive; otherwise following renames only works for toplevel files. Bug: 302549 Change-Id: I70867928eadf332b0942f8bf6877a3acb3828c87 Signed-off-by: Carsten Pfeiffer <carsten.pfeiffer@gebit.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Merge "Do not use the deprecated Tree class internally"Christian Halstrick2011-11-091-31/+47
|\
| * Do not use the deprecated Tree class internallyRobin Rosenberg2011-11-091-31/+47
| | | | | | | | | | | | Replace it with DirCache, like we did to remove GitIndex. Change-Id: Ia354770cee5c68f19945279b34aef6de54697435
* | Kill GitIndexRobin Rosenberg2011-11-091-481/+0
|/ | | | | | | | | | A few places were still using GitIndex. Replacing it was fairly simple, but there is a difference in test outcome in ReadTreeTest.testUntrackedConflicts. I believe the new behavior is good, since we do not update neither the index, not the worktree. Change-Id: I4be5357b7b3139dded17f77e07a140addb213ea7 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Deprecate GitIndex more by using only DirCache internally.Robin Rosenberg2011-11-094-846/+808
| | | | | | | | | | | | | | | | This includes merging ReadTreeTest into DirCacheCheckoutTest and converting IndexDiffTest to use DirCache only. The GitIndex specific T0007GitIndex test remains. GitIndex is deprecated. Let us speed up its demise by focusing the DirCacheCheckout tests to using DirCache instead. This also add explicit deprecation comments to methods that depend on GitIndex in Repository and TreeEntry. The latter is deprecated in itself. Change-Id: Id89262f7fbfee07871f444378f196ded444f2783 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Don't throw away the stack trace when tests failRobin Rosenberg2011-11-062-120/+82
| | | | | | | | | | | | Most unexpected exceptions are completely useless yielding message like "null" or "3" or in the best cases something reasonable, but still out of context. Just declare the test as throwing an exception. That will retain the full stack trace leading to the point of failure without using a debugger or changing the code. Change-Id: Id2454d328d1aa665606ae002de2c3805fe7baa8e
* Merge "Allow '\' in user names in URI-ish"Shawn Pearce2011-11-041-0/+66
|\
| * Allow '\' in user names in URI-ishRobin Rosenberg2011-11-041-0/+66
| | | | | | | | | | | | | | | | | | Actually this is not ok according to the RFC, but this implementation is ment to be Git compatible. A '\' is needed when the authentication requires or allows authentication to a Windows domain where the user name can be specified as DOMAIN\user. Change-Id: If02f258c032486f1afd2e09592a3c7069942eb8b
* | Provide an id for submodule entries.Kevin Sawicki2011-11-041-0/+171
|/ | | | | | | | Open a repository for submodule entries that have a child .git directory and use the resolved HEAD commit as the entry's id. Change-Id: I68d6e127f018b24ee865865a2dd3011a0e21453c Signed-off-by: Kevin Sawicki <kevin@github.com>
* Merge "Close the repo in CloneCommandTest"Christian Halstrick2011-10-271-0/+1
|\
| * Close the repo in CloneCommandTestRobin Rosenberg2011-10-261-0/+1
| | | | | | | | | | | | The test failed on Windows only Change-Id: Ibff5308b33deb73570626a08a04e86ad8f418023
* | Merge changes I488e9c97,I30f1049f,I1c088dceMatthias Sohn2011-10-262-2/+128
|\ \ | | | | | | | | | | | | | | | | | | * changes: Cosmetic adjustment of relative date format, do not display "0 months" Make use of the many date formatting options in the log command Define a utility class for handling Git date formats
| * | Cosmetic adjustment of relative date format, do not display "0 months"Robin Rosenberg2011-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | Though it may seem less precise, "0 months" looks bad and the reference Git implementation also does not display "0 months" Change-Id: I488e9c97656f9941788ae88d7c5c1562ab6c26f0
| * | Define a utility class for handling Git date formatsRobin Rosenberg2011-10-231-0/+126
| |/ | | | | | | | | | | | | | | | | Besides the formats known by git-log(1) we also add "locale" and "localelocal" that formats dates according to the user's locale. "locale" does not translate into local timezone, while localelocal does. Change-Id: I1c088dcec992c107e43f6c17be4ac9ed6eb428bf
* | Merge "Allow detecting which files were renamed during a revwalk"Matthias Sohn2011-10-262-0/+179
|\ \ | |/ |/|
| * Allow detecting which files were renamed during a revwalkCarsten Pfeiffer2011-10-252-0/+179
| | | | | | | | | | | | | | | | | | | | | | | | The egit history view shows the files associated with a commit by using a PathFilter. When following renames with a FollowFilter, the PathFilter cannot be configured anymore because the affected files are simply not known. Thus, it should be possible to get to know which files are renamed. Bug: 302549 Change-Id: I4761e9f5cfb4f0ef0b0e1e38991401a1d5003bea
* | Use the SystemReader to get system timeRobin Rosenberg2011-10-201-1/+9
|/ | | | Change-Id: Ib79c0cc964bfe799b204419e552b9aa6243966ce
* Fix bad checkout behaviour when a file is removedRobin Rosenberg2011-10-181-0/+30
| | | | | | | | | | | We deleted the entry if there was a file and an index entry, but not when there was just an index entry. Now delete the file in both cases since the missing file just means our worktree is dirty. This affected the implementation of reset --hard. Bug: 347574 Change-Id: Ie66fa61303472422830f5e33614e93ad65094e5d
* Merge changes I7cdb563b,I7f60ae68,I7bd1e769,I92683805,I0e51a8e6Shawn O. Pearce2011-10-071-9/+19
|\ | | | | | | | | | | | | | | | | * changes: UploadPack: Fix races in smart HTTP negotiation PackWriter: Export more statistics Do not requeue state vector in stateless RPC fetch Wrap excessively long line in BasePackFetchConnection Fix smart HTTP client stream alignment errors
| * Fix smart HTTP client stream alignment errorsShawn O. Pearce2011-09-141-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The client's use of UnionInputStream was broken when combined with a 8192 byte buffer used by PackParser. A smart HTTP client connection always pushes in the execute stateless RPC input stream after the data stream has ended from the remote peer. At the end of the pack, PackParser asked to fill a 8192 byte buffer, but if only e.g. 1000 bytes remained UnionInputStream went to the next stream and asked it for input, which triggered a new RPC, and failed because there was nothing pending in the request buffer. Change UnionInputStream to only return what it consumed from a single InputStream without invoking the next InputStream, just in case that second InputStream happens to be one of these magical ones that generates an RPC invocation. Change-Id: I0e51a8e6fea1647e4d2e08ac9cfc69c2945ce4cb Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge "Fix DirCacheEdtor.DeleteTree for empty string argument"Christian Halstrick2011-10-051-0/+117
|\ \
| * | Fix DirCacheEdtor.DeleteTree for empty string argumentRobin Rosenberg2011-10-011-0/+117
| | | | | | | | | | | | Change-Id: I7425da91c0752ae82484e3c29d21b57402d30c61
* | | Do not attempt to resolve describe-labels with less than four digitsRobin Rosenberg2011-10-031-0/+4
| | | | | | | | | | | | | | | Change-Id: I21dcd3cca3b41102fd898238d8d640dea25e0caf Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | | Add blame unit test for file that is renamed twice.Kevin Sawicki2011-09-301-0/+42
| | | | | | | | | | | | | | | | | | | | | Bug: 354507 Change-Id: I853774ecc1662d095a50a9668431c6e3ce4156c4 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | Merge "Use bundle dependency for org.hamcrest.org"Robin Rosenberg2011-09-301-4/+4
|\ \ \
| * | | Use bundle dependency for org.hamcrest.orgMatthias Sohn2011-09-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is required to make org.eclipse.jgit.test compile when SWTBot isn't installed which should only be necessary for EGit developers. Change-Id: I7fc22ca9fc3048cdcf211c56612a3d1b8bed8f6e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Fire IndexChangedEvent on DirCache.commit()Matthias Sohn2011-09-301-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we replaced GitIndex by DirCache JGit didn't fire IndexChangedEvents anymore. For EGit this still worked with a high latency since its RepositoryChangeScanner which is scheduled to run each 10 seconds fires the event in case the index changes. This scanner is meant to detect index changes induced by a different process e.g. by calling "git add" from native git. When the index is changed from within the same process we should fire the event synchronously. Compare the index checksum on write to index checksum when index was read earlier to determine if index really changed. Use IndexChangedListener interface to keep DirCache decoupled from Repository. Change-Id: Id4311f7a7859ffe8738863b3d86c83c8b5f513af Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | Fix status in index entries after checkout of pathsChristian Halstrick2011-09-281-0/+52
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The checkout command was producing an inconsistent state of the index which even confuses native git. The content sha1 of the touched index entries was updated, but the length and the filemode was not updated. Later in coding the index entries got automatically corrected (through Dircache.checkoutEntry()) but the correction was after persisting the index to disk. So, the correction was lost and we ended up with an index where length and sha1 don't fit together. A similar problem is fixed with "lastModified" of DircacheEntry. When checking out a path without specifying an explicit commit (you want to checkout what's in the index) the index was not updated regarding lastModified. Readers of the index will think the checked-out file is dirty because the file has a younger lastmodified then what's in the index. Change-Id: Ifc6d806fbf96f53c94d9ded0befcc932d943aa04 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Bug: 355205
* | | Merge "Fix DirCache,getEntriesWithin for empty string arguemnt"Christian Halstrick2011-09-261-0/+7
|\| |
| * | Fix DirCache,getEntriesWithin for empty string arguemntRobin Rosenberg2011-09-251-0/+7
| | | | | | | | | | | | Change-Id: I0bea130df611de3ef8c9251093b11c62b5442cd1
* | | Test the reflog message for commit, cherry-pick, revert and mergeRobin Rosenberg2011-09-214-1/+61
|/ / | | | | | | | | | | Change-Id: I319f09577b3e04f6c31399fe8e57e9a9ad2c8a6c Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare 1.2.0 buildsMatthias Sohn2011-09-152-33/+33
| | | | | | | | | | Change-Id: I9ec247135d93ef28d732e94f18d0ec1d0e2e6d44 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Prepare post v1.1.0.201109151100-r buildstable-1.1Matthias Sohn2011-09-152-2/+2
| | | | | | | | | | Change-Id: Ib099ec93d8243b238641d79328216874532ab5eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | JGit v1.1.0.201109151100-rv1.1.0.201109151100-rMatthias Sohn2011-09-152-2/+2
|/ | | | | Change-Id: Iadcec7e5973600e005cbdeb837fa197d3ae2ea86 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare post v1.1.0.201109071825-rc3 buildsMatthias Sohn2011-09-082-2/+2
| | | | | Change-Id: I1244f6639263d156a6f9e4530167e5eb1826a535 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v1.1.0.201109071825-rc3v1.1.0.201109071825-rc3Matthias Sohn2011-09-082-2/+2
| | | | | Change-Id: I1b989d3101272632eacabe25a0b111ad0ff5bb3b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use commit message best practices for Mylyn Commit templateMatthias Sohn2011-09-052-0/+7
| | | | | | | | | | We should use a template for Mylyn commit messages that matches with our guidelines for commit messages. http://wiki.eclipse.org/EGit/Contributor_Guide#Commit_message_guidelines Bug: 337401 Change-Id: I05812abf0eb0651d22c439142640f173fc2f2ba0 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add a helper for parsing branch switch info out of a reflog entryRobin Rosenberg2011-09-051-0/+18
| | | | | | Change-Id: I91c7e08c4afd2562df2226887a933d93c78a0371 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Prepare post-v1.1.0.201109011030-rc2 buildsMatthias Sohn2011-09-012-2/+2
| | | | Change-Id: I8dda83cdbe88beba4a480df9846848bf3aceb9e2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v1.1.0.201109011030-rc2v1.1.0.201109011030-rc2Matthias Sohn2011-09-012-2/+2
| | | | | Change-Id: Ie6d65fe45ad92c813ce3a227729aa43681922249 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix boxing warnings in PushProcessTestTomasz Zarna2011-08-241-7/+7
| | | | Change-Id: I5114968536853fb530b8a96c10def675e39c884f
* Throw JGit exception when ResetCommand got wrong refChristian Halstrick2011-08-211-0/+17
| | | | | | | | | | | | If the ResetCommand should reset to a invalid ref (e.g. HEAD in a repo whithout a single commit) it was throwing an NPE. This is fixed now by throwing a JGitInternalExcpeption. It would be nicer if we could throw a InvalidRefException, but this would modify our API. Bug: 339610 Change-Id: Iffcb4f2cca9f702176471d93c3a71e5cb3e700b1 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>