summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* IndexDiff: Clean up tree-index compare for staged filesShawn O. Pearce2010-12-081-2/+3
| | | | | | | | | | | | | | When comparing the ObjectIds for two tree entries its faster to use the raw buffer compares over allocating ObjectIds and then performing equals on their contents. However, this also needs to consider the raw modes. It is possible for a path to change modes but not ObjectId (e.g. making a file executable), and in this case its still a staged change to report back to the caller. Change-Id: I1a267254c04b3273a97f63c71d1e6718cd9d2fa8 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* IndexDiff: Fix getAssumeUnchanged()Shawn O. Pearce2010-12-081-7/+12
| | | | | | | | | | | | | If the caller really needs the list of files that are flagged as assume-unchanged (aka assume-valid in the DirCache), we should give them the complete list and not just those that we wrongly identified as being modified during diff(). This change is necessary because diff() is slightly broken and is discovering differences on files that it shouldn't have considered. Change-Id: Ibe464c1a0e51c19dc287a4bc5348b7b07f4d840b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* IndexDiff: Correct Javadoc for getUntracked() methodShawn O. Pearce2010-12-081-1/+1
| | | | | Change-Id: I5f26c40dec5f0e4a47413af033dbedb0c252dd20 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* IndexDiff: Remove always true not-subtree checkShawn O. Pearce2010-12-081-7/+4
| | | | | | | | | The TreeWalk is configured to be recursive, which means subtrees are never presented to the application. Therefore the working tree file mode can never be a subtree/subdirectory at this point in the code. Change-Id: Ie842ddc147957d09205c0d2ce87b25c566862fd9 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* IndexDiff: Always use TreeWalk.getPathString()Shawn O. Pearce2010-12-081-9/+8
| | | | | | | | | Instead of asking the individual iterators for their path string, use the TreeWalk's generic getPathString() method. Its just as fast because it uses the path of the current matching iterator. Change-Id: I9b827fbbafce1c78f09d5527cdc64fbe9022a16e Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* IndexDiff: Simplify allocation of filter listShawn O. Pearce2010-12-081-2/+1
| | | | | | | | | We add either 3 or 4 filters. If we are adding only 3 filters, allocating the array for 4 isn't a huge waste of memory, but it does simplify our code. Change-Id: I7df29b414f6d5cfcf533edb1405083e6fcec32cf Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Clarify WorkingTreeOptions and filemode usageShawn O. Pearce2010-12-0810-123/+51
| | | | | | | | | | | | | | | | | | | | | | To improve runtime performance, caching the WorkingTreeOptions inside of the Config object using the Config.SectionParser API allows the WorkingTreeOptions to be accessed more efficiently whenever a FileTreeIterator is constructed for the Repository. Instead of passing the filemode handling option into isModified(), the WorkingTreeIterator should always honor whatever setting has been configured in this repository, as defined by its own copy of the WorkingTreeOptions. This simplifies all of the callers as they no longer need to lookup core.filemode on their own. A few locations were changed from always using a hardcoded "true" on the file mode to passing what is actually configured in the repository. This is a behavior change, but corrects what should be considered to be bugs as the core.filemode variable wasn't always being used. Change-Id: Idb176736fa0dc97af372f1d652a94ecc72fb457c Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* IndexPack: Use streaming for large whole blobsShawn O. Pearce2010-12-082-6/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | When indexing large blobs that are stored whole (non-delta form), avoid allocating the entire blob in memory and instead stream it through the SHA-1 checksum computation. This reduces the size of memory required by IndexPack when processing very big blobs, such as a 500 MiB uncompressable binary. If the large blob already exists in the local repository, its contents needs to be compared byte-for-byte after the entire pack has been indexed, to ensure there isn't an unexpected SHA-1 collision which may result in later data corruption. This compare is performed as a streaming compare, again avoiding the large object allocation. This change doesn't improve on memory utilization for large objects stored as deltas. The change also doesn't improve handling for any large commits, trees or annotated tags. There isn't much to be done here for those objects, because they need to be passed down to the ObjectChecker as a byte[]. Fortunately it isn't common for these object types to be that large, Bug: 312868 Change-Id: I862afd4cb78013ee033d4ec68c067b1774a05be8 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com> CC: Roberto Tyley <roberto.tyley@guardian.co.uk>
* Merge "Refactor IndexPack to use InputStream for inflation"Chris Aniszczyk2010-12-081-59/+122
|\
| * Refactor IndexPack to use InputStream for inflationShawn O. Pearce2010-12-071-59/+122
| | | | | | | | | | | | | | | | | | | | | | By inflating with an InputStream like API, it is possible to stream through large objects rather than allocating the entire thing as a byte[]. This change only refactors the inflation code within IndexPack to use a streaming interface. Change-Id: I5a84b486901c2cf63fa6a3306dd5fb5c53b4056b Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: Roberto Tyley <roberto.tyley@guardian.co.uk>
* | Removed unread parametersChristian Halstrick2010-12-083-28/+20
| | | | | | | | | | | | | | | | | | | | Some method parameters in WorkingTreeIterator are never used. Remove them. Especially the removal of the FS parameter in isModified() simplifies upcoming performance optimizations. Change-Id: I7c449589283a4a6b6e23f2586cd784febdca8bcd Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Introduce http test bundleJens Baumgart2010-12-0832-59/+810
| | | | | | | | | | | | | | | | | | | | Introduce a http test bundle to make this functionality available for EGit tests. A simple http server class is provided. The jetty version was updated to a version that is also available via p2 (needed in EGit UI tests). Change-Id: I13bfc4c6c47e27d8f97d3e9752347d6d23e553d4 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Remove empty iterator from TreeWalkShawn O. Pearce2010-12-0721-36/+12
|/ | | | | | | | | | | | | | | | | Its confusing that a new TreeWalk() needs to have reset() invoked on it before addTree(). This is a historical accident caused by how TreeWalk was abused within ObjectWalk. Drop the initial empty tree from the TreeWalk and thus remove a number of pointless reset() operations from unit tests and some of the internal JGit code. Existing application code which is still calling reset() will simply be incurring a few unnecessary field assignments, but they should consider cleaning up their code in the future. Change-Id: I434e94ffa43491019e7dff52ca420a4d2245f48b Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* [findbugs] Do not ignore exceptional return valueMatthias Sohn2010-12-0722-57/+79
| | | | | | | | | | java.io.File.delete() reports failure as an exceptional return value false. Fix the code which silently ignored this exceptional return value. Also remove some duplicate deletion helper methods. Change-Id: I80ed20ca1f07a2bc6e779957a4ad0c713789c5be Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Provide file utilities for file deletionMatthias Sohn2010-12-073-1/+133
| | | | | | | | | | | Provide file helper methods in a reusable utility class to replace many local implementations. java.io.File has some methods reporting failure by returning false. We prefer to throw IOException on failure so that callers can't forget checking the return value. Change-Id: I430c77b5d2cffcf8b47584326ad4817a7291845e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Clean up Init API"Chris Aniszczyk2010-12-071-13/+13
|\
| * Clean up Init APIChris Aniszczyk2010-12-071-13/+13
| | | | | | | | | | | | | | Static accessors should come before a constructor. Change-Id: Iee1051ce4f2038f19a08741e7a3a33f06a97a3c0 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Avoid NPE in InitChris Aniszczyk2010-12-071-2/+5
|/ | | | | | | | We should grab the repository directory from the command to avoid an NPE if no git directory is passed in via the CLI. Change-Id: I649467c6d84bbc0d26a070d0d4ff1e6f81fd5bad Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Rebase Interoperability third part: handle stop upon conflict"Chris Aniszczyk2010-12-071-1/+26
|\
| * Rebase Interoperability third part: handle stop upon conflictMathias Kinzler2010-12-071-1/+26
| | | | | | | | | | | | | | | | There are some files that need to exist so that the CLI can continue after the rebase has been stopped due to conflicts Change-Id: I3cb4dc98609c059bf0cf9fd5f9e47a9c681cea2d Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | Merge "Rebase Interoperability second part: fix "pop steps""Chris Aniszczyk2010-12-072-17/+33
|\|
| * Rebase Interoperability second part: fix "pop steps"Mathias Kinzler2010-12-012-17/+33
| | | | | | | | | | | | | | | | | | | | If the CLI stops a rebase upon conflict, the current step is already popped from the git-rebase-todo and appended to the "done" file. The current implementation wrongly pops the step only after successful cherry-pick. Change-Id: I8640dda0cbb2a5271ecf75fcbad69410122eeab6 Signed-off-by: Mathias Kinzler <mathias.kinzler@sap.com>
* | Merge "LockFile.commit: retry renaming"Shawn Pearce2010-12-061-1/+20
|\ \
| * | LockFile.commit: retry renamingJens Baumgart2010-12-061-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the following can happen in LockFile.commit: deletion of the original file succeeds but renaming fails afterwards. In this case the original file (e.g. branch file in refs/heads) is lost. To workaround the issue the same retry logic as for file deletion is applied to file renaming. Bug: 331890 Change-Id: I68620c07f2d3ab7f3279c71a91e184e8eac69832 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Philipp Thun <philipp.thun@sap.com>
* | | Merge "Update Init to use InitCommand"Chris Aniszczyk2010-12-061-9/+7
|\ \ \
| * | | Update Init to use InitCommandChris Aniszczyk2010-12-051-9/+7
| | | | | | | | | | | | | | | | | | | | Change-Id: I3ff700a87dfa6ac255c1aaf3fe11a07264594aab Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | Merge "Add InitCommand"Chris Aniszczyk2010-12-063-1/+234
|\| | |
| * | | Add InitCommandChris Aniszczyk2010-12-053-1/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds git-init support to the Git API. Change-Id: I1428b861f22cabe4d92cadf3d9114dddeec75b40 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | Merge "Add debugging toString to TreeFormatter"Chris Aniszczyk2010-12-061-0/+36
|\ \ \ \
| * | | | Add debugging toString to TreeFormatterShawn O. Pearce2010-12-031-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Displaying the current tree in the ls-tree style output makes it easier to see what entries are currently stored. Change-Id: If17c414db0d2e8d84e65de8bbcba7fd1b79aa311 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | | Merge "Add insert(TreeFormatter) to ObjectInserter"Chris Aniszczyk2010-12-065-5/+21
|\| | | |
| * | | | Add insert(TreeFormatter) to ObjectInserterShawn O. Pearce2010-12-035-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes usage of a TreeFormatter more similar to a CommitBuilder or a TagBuilder: populate the formatter and pass to the ObjectInserter. Change-Id: I5a45ef3a35cc73f4905a34bc6f6228510df8eb2c Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | | Merge "Add toByteArray to CommitBuilder, TreeBuilder"Chris Aniszczyk2010-12-062-0/+23
|\| | | |
| * | | | Add toByteArray to CommitBuilder, TreeBuilderShawn O. Pearce2010-12-032-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This better matches the existing API of TreeFormatter, but is just a simple delegation to build(). Change-Id: I188f43acc34455e773d63836724b05e18f5c7a84 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | | Merge "Remove unused getTreeId from TreeFormatter"Chris Aniszczyk2010-12-061-19/+0
|\| | | |
| * | | | Remove unused getTreeId from TreeFormatterShawn O. Pearce2010-12-031-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If5955757575d4c6053b6f8109e9dc2ecb0502446 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | | Merge "Remove result id from CommitBuilder, TagBuilder"Chris Aniszczyk2010-12-066-144/+40
|\| | | | | |_|/ / |/| | |
| * | | Remove result id from CommitBuilder, TagBuilderShawn O. Pearce2010-12-036-144/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These objects don't need to be updated with the resulting ObjectId of the formatted content, callers can get that from the ObjectInserter on their own. Change-Id: Idc5f097de9f7beafc5e54e597383d82daf9d7db4 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | Merge "Honor GIT_SSH when opening SSH connections"Chris Aniszczyk2010-12-051-0/+89
|\ \ \ \
| * | | | Honor GIT_SSH when opening SSH connectionsShawn O. Pearce2010-12-031-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the environment variable GIT_SSH is set, use GIT_SSH for any remote protocol connections, instead of the local JSch library. Bug: 321062 Change-Id: Ia18ea49d58f3ed657430067f1f72ef788a2dae4c Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | | | Merge "Ensure stable tag sort in PlotWalk"Shawn O. Pearce2010-12-051-2/+19
|\ \ \ \ \
| * | | | | Ensure stable tag sort in PlotWalkShawn O. Pearce2010-12-031-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because tags are more interesting here than local or remote branch heads, tags get sorted earlier in the array than heads or remotes do. Bug: 324939 Change-Id: Ifc3863461654df7f34fdecbd2abe1f4b5d2ffb8e Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: Mathias Kinzler <mathias.kinzler@sap.com> CC: Stefan Lay <stefan.lay@sap.com>
* | | | | | Merge "Abstract SSH setup to support GIT_SSH"Chris Aniszczyk2010-12-051-89/+126
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Abstract SSH setup to support GIT_SSHShawn O. Pearce2010-12-031-89/+126
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to honor GIT_SSH the TransportGitSsh class needs to run the process named by the GIT_SSH environment variable and use that as the pipes for connectivity to the remote peer. Refactor the current transport code to support a different type of pipe connectivity, so we can later add GIT_SSH. Bug: 321062 Change-Id: I9d8ee1a95f1bac5013b33a4a42dcf1f98f92172f Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | | | Fix findGitDir() with no ceiling directoriesShawn O. Pearce2010-12-052-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 322866 Change-Id: I64205bb0315a725dfa523ccff1796de50f465162 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: Ketan Padegaonkar <KetanPadegaonkar@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | Merge "Correct CommitBuilder, TagBuilder method to be build()"Matthias Sohn2010-12-055-10/+10
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Correct CommitBuilder, TagBuilder method to be build()Shawn O. Pearce2010-12-035-10/+10
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The correct names for these is build(), as that is what a Java developer will expect given the "builder" pattern. Bug: 323541 Change-Id: I35042bdc95a955beeaee29e54bde10e4240b2a71 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | | | Merge "Fix checking out large files"Robin Rosenberg2010-12-041-15/+2
|\ \ \ \
| * | | | Fix checking out large filesShawn O. Pearce2010-12-031-15/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DirCacheCheckout needs to use ObjectLoader.copyTo to avoid loading the complete content of a large file into the JVM heap. Bug: 321097 Change-Id: I967590b6f233fd1c83d873075db01d653208b3b9 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> CC: Chris Aniszczyk <caniszczyk@gmail.com> CC: Christian Halstrick <christian.halstrick@sap.com>
* / / / Add missing license headerMatthias Sohn2010-12-031-0/+43
|/ / / | | | | | | | | | Change-Id: Ibfd17951606f02283660befcff53ff9b73405dd9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>