summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Performance improvement on writing a large indexStephen Lawson2017-11-231-2/+6
| | | | | | | | | | | | | | | | | | The index header consists of a 4-byte version number. The current supported version numbers are 2 and 3. The code checks if any entries are extended. If it finds any entries that are extended it picks version '3', otherwise it chooses version '2'. DirCache.java -Changed the 'extended' check to exit early when any entry is considered 'extended' in the index. (Of course, I maybe missing a bitwise optimization that is made in the Java bytecode.) Change-Id: If70db9454befe683319b974ebd3774060be9445d Signed-off-by: Stephen Lawson <slawson@ptc.com>
* Upgrade maven-compiler-plugin to 3.7.0David Pursehouse2017-11-231-1/+1
| | | | | Change-Id: I9c4a591b809cee702b2d064d74c9809c023c78c8 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix discouraged access warnings in RefsUnreadableInMemoryRepositoryMatthias Sohn2017-11-241-1/+2
| | | | Change-Id: I16e291f533625c80b1d39f7cbaf40efbdfcc2c3c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-4.9'Matthias Sohn2017-11-2424-103/+330
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Ignore warning for minor version change without API change Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: Icc33d2e36f140e8714fce088379673a8834ae9de
| * Ignore warning for minor version change without API changeMatthias Sohn2017-11-2417-13/+177
| | | | | | | | | | | | | | | | - this is a new warning option in Eclipse 4.7 and higher - we always change version of all bundles in a release to keep release engineering simple Change-Id: Ic7523d77b67b2802f1bab3bc70af250d712a034f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Merge branch 'stable-4.8' into stable-4.9Matthias Sohn2017-11-247-63/+176
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.8: Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: I7cf2e48934195430b3945b6d74b092f93a3ccd36 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Merge branch 'stable-4.7' into stable-4.8Matthias Sohn2017-11-226-12/+160
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.7: Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: Iaa99ec84594baf733c993c2d6768281ff14f545a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Merge branch 'stable-4.6' into stable-4.7Matthias Sohn2017-11-227-44/+158
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.6: Silence boxing warning Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: I8f6bc09540727c6273d22775a9f9ca382a729c9b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * Silence boxing warningMatthias Sohn2017-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I36c40eb91ce0c51f89b47911fa14beffcbc0a7cd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | * Merge branch 'stable-4.5' into stable-4.6Matthias Sohn2017-11-228-40/+195
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.5: Prepare 4.5.5-SNAPSHOT builds JGit v4.5.4.201711221230-r Fix LockFile semantics when running on NFS Honor trustFolderStats also when reading packed-refs Prepare 4.5.4-SNAPSHOT builds JGit v4.5.3.201708160445-r Change-Id: Ie9c8e0d9172c8d53f075c284bf2a9677980d8dfb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * Prepare 4.5.5-SNAPSHOT buildsMatthias Sohn2017-11-2256-302/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I71f946f2875716670a2d74c21a8ab38a1f53a25c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * JGit v4.5.4.201711221230-rv4.5.4.201711221230-rMatthias Sohn2017-11-2256-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia1079da239c5b3fde1ba8d2acc4e465a46297b4d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * Fix LockFile semantics when running on NFSChristian Halstrick2017-11-225-3/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running on NFS there was a chance that JGits LockFile semantic is broken because File#createNewFile() may allow multiple clients to create the same file in parallel. This change provides a fix which is only used when the new config option core.supportsAtomicCreateNewFile is set to false. The default for this option is true. This option can only be set in the global or the system config file. The repository config file is not taken into account in this case. If the config option core.supportsAtomicCreateNewFile is true then File#createNewFile() is trusted and the behaviour doesn't change. But if core.supportsAtomicCreateNewFile is set to false then after successful creation of the lock file a hardlink to that lock file is created and the attribute nlink of the lock file is checked to be 2. If multiple clients manage to create the same lock file nlink would be greater than 2 showing the error. This expensive workaround is described in https://www.time-travellers.org/shane/papers/NFS_considered_harmful.html section III.d) "Exclusive File Creation" Change-Id: I3d2cc48d8eb280d5f7039eb94da37804f903be6a
| | | | | * Honor trustFolderStats also when reading packed-refsChristian Halstrick2017-11-211-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Then list of packed refs was cached in RefDirectory based on mtime of the packed-refs file. This may fail on NFS when attributes are cached. A cached mtime of the packed-refs file could cause JGit to trust the cached content of this file and to overlook that the file is modified. Honor the config option trustFolderStats and always read the packed-refs content if the option is false. By default this option is set to true and this fix is not active. Change-Id: I2b65cfaa8f4aba2efbf8a5e865d3f09f927e2eec
| | | | | * Prepare 4.5.4-SNAPSHOT buildsMatthias Sohn2017-08-2656-302/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Id8b902bf2bf590b41f2e246c5ecf1592e1c411f2 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | | | * JGit v4.5.3.201708160445-rv4.5.3.201708160445-rMatthias Sohn2017-08-1656-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2d57144976e3683e180d3a42edc6c3bf2905e87c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | Merge branch 'stable-4.9'David Pursehouse2017-11-222-4/+61
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Yet another work-around for a Jsch bug: timeouts Change-Id: I7cf227c62a3c06f91cee1a6c61719b6fe50da883 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | | | | Yet another work-around for a Jsch bug: timeoutsThomas Wolf2017-11-202-4/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jsch 0.1.54 passes on the values from ~/.ssh/config for "ServerAliveInterval" and "ConnectTimeout" as read from the config file to java.net.Socket.setSoTimeout(). That method expects milliseconds, but the values in the config file are seconds! The missing conversion in Jsch means that the timeout is set way too low, and if the server doesn't respond within that very short time frame, Jsch kills the connection and then throws an exception with a message such as "session is down" or "timeout in waiting for rekeying process". As a work-around, do the conversion to milliseconds in the Jsch-facing Config interface of OpenSshConfig. That way Jsch already gets these values as milliseconds. Bug: 526867 Change-Id: Ibc9b93f7722fffe10f3e770dfe7fdabfb3b97e74 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | | Config: Handle leading/trailing single whitespacesDave Borowitz2017-11-202-3/+71
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I468106acd2006d0a174c76dfd4bce231f1c7a6f8
* | | | | | Merge branch 'stable-4.9'David Pursehouse2017-11-203-9/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Fix NPE in TransportGitSsh.ExtSession.exec() Add missing help text for rev-parse's --verify option Remove final modifier on args4j argument field in RevParse Change-Id: I5ac9e2f185f2210ee76970501710b99b12e93e75 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | | | | Fix NPE in TransportGitSsh.ExtSession.exec()Matthias Sohn2017-11-201-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 527383 Change-Id: I965860b4e0e9aa1adf6a1bb0735940cbd22adced Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | Add missing help text for rev-parse's --verify optionMatthias Sohn2017-11-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3345f52e0c2a555e4c5edb7effe4be4af4cca10a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | Remove final modifier on args4j argument field in RevParseRüdiger Herrmann2017-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Args4J does no longer allow to use final fields to reference arguments or options [1]. Change RevParse to be compatibel with this change. [1] https://github.com/kohsuke/args4j/commit/6e11f89d40dcc518c0e5eb9eef5d74f05d58e6af See-also: a0558b709448cea01cc0725fff73408d9b223c72 Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de> Change-Id: I33b233f195c06855d9e094c8c9ba804fbe7b1438
* | | | | | Merge changes from topic 'includeDeletes'Shawn Pearce2017-11-164-1/+117
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Add flag for keeping ref tombstones in GC reftable Preserve ref tombstone when compact top retable stack
| * | | | | | Add flag for keeping ref tombstones in GC reftableMinh Thai2017-11-153-1/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A tombstone will prevent a delayed reference update from resurrecting the deleted reference. Change-Id: Id9f4df43d435a299ff16cef614821439edef9b11 Signed-off-by: Minh Thai <mthai@google.com>
| * | | | | | Preserve ref tombstone when compact top retable stackMinh Thai2017-11-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I07f5ad572b4642a7cdd76d92aa98f3b6c63d9fa2 Signed-off-by: Minh Thai <mthai@google.com>
* | | | | | | Remove unused import from ReftableCompactorTestMatthias Sohn2017-11-151-1/+0
|/ / / / / / | | | | | | | | | | | | | | | | | | Change-Id: Ib6d7fb6b56a94be307b07fefacf5d9c77fce0447 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | TreeWalk: Make getEolStreamType(OperationType) publicDavid Pursehouse2017-11-155-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and deprecate getEolStreamType(). This resolves a TODO that was apparently supposed to be done in version 4.4. Change-Id: I5c9861aedabdc3f99dcf47519b3959a979e6a591
* | | | | | TreeWalk: Fix indentationDavid Pursehouse2017-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I040aaaf4e3f1e3458e0ece52d1d046f501272fc2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | | | | Merge "ObjectDirectory: Add pack directory getter"David Pursehouse2017-11-1411-18/+22
|\ \ \ \ \ \
| * | | | | | ObjectDirectory: Add pack directory getterHector Caballero2017-11-1411-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, in order to get the pack directory it was necessary to resolve it from the object directory. This resolution is already done when creating the object directory, so simplify the call by just adding a getter to the pack directory. Change-Id: I69e783141dc6739024e8b3d5acc30843edd651a7 Signed-off-by: Hector Caballero <hector.caballero@ericsson.com>
* | | | | | | Merge "Add return tag"David Pursehouse2017-11-141-2/+3
|\| | | | | |
| * | | | | | Add return tagHector Caballero2017-11-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eclipse was complaining about the missing tag for the return type. Change-Id: I43c7e823c3090b19dc8202c1e4d7968e1fa8e6bb Signed-off-by: Hector Caballero <hector.caballero@ericsson.com>
* | | | | | | Merge "ReftableCompactor should accept 0 for minUpdateIndex"Jonathan Nieder2017-11-142-3/+329
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | ReftableCompactor should accept 0 for minUpdateIndexMinh Thai2017-11-142-3/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not use 0 as the unset value for minUpdateIndex, as input reftables may have minUpdateIndex starting at 0. Change-Id: Ie040a6b73d4a5eba5521e51d0ee4580713c84a3e Signed-off-by: Minh Thai <mthai@google.com>
* | | | | | | FileUtils.toPath to convert File to PathMarc Strapetz2017-11-148-21/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When invoking File.toPath(), an (unchecked) InvalidPathException may be thrown which should be converted to a checked IOException. For now, we will replace File.toPath() by FileUtils.toPath() only for code which can already handle IOExceptions. Change-Id: I0f0c5fd2a11739e7a02071adae9a5550985d4df6 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* | | | | | | Silence invalid @since 3.5 API warning on ResolveMerge#processEntryMatthias Sohn2017-11-131-0/+7
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method was removed in 4.9 and reintroduced in I48ba4308dee73925fa32d6c2fd6b5fd89632c571 as deprecated in 4.9.1 in order to help EMF Compare to avoid breakage. Change-Id: Ia638517178313da42ae13ebcf88ad535d9a02723 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | Merge changes I335587ee,I4182a174David Pursehouse2017-11-106-1/+104
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Merge branch 'stable-4.9' Remove an unused import from PackParserTest
| * | | | | | Merge branch 'stable-4.9'Matthias Sohn2017-11-115-0/+104
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Work around a Jsch bug: ensure the user name is set from URI Reintroduce protected method which removal broke EMF Compare Change-Id: I335587eee279f91bd36c9ba9fc149b17a6db6110 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * | | | | Work around a Jsch bug: ensure the user name is set from URIThomas Wolf2017-11-103-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JSch unconditionally overrides the user name given in the connection URI by the one found in ~/.ssh/config (if that does specify one for the used host). If the SSH config file has a different user name, we'll end up using the wrong name, which typically results in an authentication failure or in Eclipse/EGit asking for a password for the wrong user. Unfortunately there is no way to prevent or circumvent this Jsch behavior up front; it occurs already in the Session constructor at com.jcraft.jsch.Session() and the Session.applyConfig() method. And while there is a Session.setUserName() that would enable us to correct this, that latter method has package visibility only. So resort to reflection to invoke that setUserName() method to ensure that Jsch uses the user name from the URI, if there is one. Bug: 526778 Change-Id: Ia327099b5210a037380b2750a7fd76ff25c41a5a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| | * | | | | Merge "Reintroduce protected method which removal broke EMF Compare" into ↵Matthias Sohn2017-11-022-0/+68
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | stable-4.9
| | | * | | | | Reintroduce protected method which removal broke EMF CompareMatthias Sohn2017-10-242-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we follow OSGi semantic versioning [1] which says the following: "A change in the second (minor) part of the version signals that the change is backward compatible with consumers of the API package but not with the providers of that API. That is, when the API package goes from version 1.5 to 1.6 it is no longer compatible with a provider of that API but consumers of that API are backward compatible with that API package." The change Ib5fbf17bdaf727bc5d0e106ce88f2620d9f87a6f broke EMF Compare which subclasses ResolveMerger since we added a new parameter to the protected ResolveMerger.processEntry() method. According to the above cited OSGi semantic versioning this is ok, implementers should expect that they break on minor version changes of the API they implement. This change reintroduces the old processEntry() method in order to help avoid breakage for existing EMF Compare versions which expect breakage also for the implementer case only for major version change (in this case from JGit 4.x to 5.x). [1] http://www.osgi.org/wp-content/uploads/SemanticVersioning1.pdf See: https://dev.eclipse.org/mhonarc/lists/jgit-dev/msg03431.html Change-Id: I48ba4308dee73925fa32d6c2fd6b5fd89632c571 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | | | | | | Remove an unused import from PackParserTestMatthias Sohn2017-11-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4182a1746b09dedab648e457d1ece6d667a01f12 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | | | | Add a setting for fsck to check connectivity onlyZhen Chen2017-11-101-1/+14
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object checks may take a long time and sometimes we are only interested in connectivity check. This is similar to 'git fsck --connectivity-only'. Change-Id: I654e8fdccdb16d796f920088429d188cc96734bc Signed-off-by: Zhen Chen <czhen@google.com>
* | | | | | | Merge changes I22a8874b,I68ed4abd,I740bc4bf,Icbd17d15Jonathan Nieder2017-11-107-123/+409
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: BitmapWalker: do not revisit objects in bitmap Use bitmaps for non-commit reachability checks Make PackWriterBitmapWalker public UploadPackTest: construct commits in test method
| * | | | | | | BitmapWalker: do not revisit objects in bitmapJonathan Tan2017-11-101-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, BitmapWalker walks through every object returned by the internal ObjectWalk, regardless of whether that object has already been marked in the bitmap. Set an object filter to ensure that only bitmap-unmarked objects are walked through. Change-Id: I22a8874b1e571df3c33643b365036d95f52fe7c7 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
| * | | | | | | Use bitmaps for non-commit reachability checksJonathan Tan2017-11-102-2/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, unless RequestPolicy#ANY is used, UploadPack rejects all non-commit "want" lines unless they were advertized. This is fine, except when "uploadpack.allowreachablesha1inwant" is true (corresponding to RequestPolicy#REACHABLE_COMMIT), in which case one would expect that "want"-ing anything reachable would work. (There is no restriction that "want" lines must only contain commits - it is allowed for refs to directly point to trees and blobs, and requesting for them using "want" lines works.) This commit has been written to avoid performance regressions as much as possible. In the usual (and currently working) case where the only unadvertized things requested are commits, we do a standard RevWalk in order to avoid incurring the cost of loading bitmaps. However, if unadvertized non-commits are requested, bitmaps are used instead, and if there are no bitmaps, a WantNotValidException is thrown (as is currently done). Change-Id: I68ed4abd0e477ff415c696c7544ccaa234df7f99 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
| * | | | | | | Make PackWriterBitmapWalker publicJonathan Tan2017-11-105-122/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make PackWriterBitmapWriter class public and move it to a more central location, in preparation for its use by another class (in a subsequent commit). One of its inner static classes, AddUnseenToBitmapFilter, previously package-private, is also used directly in its former package. Therefore, AddUnseenToBitmapFilter and its sibling class have been moved to an internal package instead. Change-Id: I740bc4bfc4e4e3c857d1ee7d25fe45e90cd22a75 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
| * | | | | | | UploadPackTest: construct commits in test methodJonathan Tan2017-11-011-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a subsequent commit, more tests will be added. This commit allows those tests to reuse fields. Change-Id: Icbd17d158cfe3ba4dacbd8a11a67f9e7607b41b3 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | | | | | | | Reject pack if delta exceeds array size limitShawn Pearce2017-11-092-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JGit's delta handling code requires the target to be a single byte array. Any attempt to inflate a delta larger than fits in the 2GiB limit will fail with some form of array index exceptions. Check for this overflow early and abort pack parsing. Change-Id: I5bb3a71f1e4f4e0e89b8a177c7019a74ee6194da