summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Strings#convertGlob: fix escaping of patterns like [\[].Dmitry Pavlenko2017-12-214-1/+72
| | | | | | | | | | Originally the patterns were escaped twice leading to wrong matching results. Bug: 528886 Change-Id: I26e201b4b0ef51cac08f940b76f381260fa925ca Signed-off-by: Dmitry Pavlenko <pavlenko@tmatesoft.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Make PackInserter publicDave Borowitz2017-12-211-1/+1
| | | | | | | | The intent with the setCompressionLevel and checkExisting methods (which are already public) is for callers to be able to call them, but they can't do that if the class itself is not public. Change-Id: I014044fec3bfa1d33775500345efd60eb5d45bde
* PackInserter: Ensure objects are written at the end of the packDave Borowitz2017-12-202-34/+149
| | | | | | | | | | | | | | | | | | | | | | | | | When interleaving reads and writes from an unflushed pack, we forgot to reset the file pointer back to the end of the file before writing more new objects. This had at least two unfortunate effects: * The pack data was potentially corrupt, since we could overwrite previous portions of the file willy-nilly. * The CountingOutputStream would report more bytes read than the size of the file, which stored the wrong PackedObjectInfo, which would cause EOFs during reading. We already had a test in PackInserterTest which was supposed to catch bugs like this, by interleaving reads and writes. Unfortunately, it didn't catch the bug, since as an implementation detail we always read a full buffer's worth of data from the file when inflating during readback. If the size of the file was less than the offset of the object we were reading back plus one buffer (8192 bytes), we would completely accidentally end up back in the right place in the file. So, add another test for this case where we read back a small object positioned before a large object. Before the fix, this test exhibited exactly the "Unexpected EOF" error reported at crbug.com/gerrit/7668. Change-Id: I74f08f3d5d9046781d59e5bd7c84916ff8225c3b
* ObjectInserter: Add warning about mixing read-back with writesDave Borowitz2017-12-201-0/+7
| | | | Change-Id: Ib0460d3c7df315d86f9adca5f66a8fd4c39e4060
* Prepare 4.9.3-SNAPSHOT buildsMatthias Sohn2017-12-1656-333/+333
| | | | | Change-Id: Ife3f2b0b5407227f89ded42358adbf01d53e14cf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.9.2.201712150930-rv4.9.2.201712150930-rMatthias Sohn2017-12-1556-59/+59
| | | | | Change-Id: I013964045d532659a4be3b81d6612b59bc9ffb14 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Write packed-refs directly when cloningThomas Wolf2017-12-152-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are cloning we have no refs at all yet, and there cannot (or at least should not) be any other thread doing something with refs yet. Locking loose refs is thus not needed, since there are no loose refs yet and nothing should be trying to create them concurrently. Let's skip the whole loose ref locking when we are cloning a repository. As a result, JGit will write the refs directly to the packed-refs file, and will not create the refs/remotes/ directories nor the lock files underneath when cloning and packed refs are used. Since no lock files are created, any problems on case-insensitive file systems with tag or branch names that differ only in case are avoided during cloning. Detect if we are cloning based on the following heuristics: * HEAD is a dangling symref * There is no loose ref * There is no packed-refs file Note, however, that there may still be problems with such tag or branch names later on. This is primarily a five-minutes-past-twelve stop-gap measure to resolve the referenced bug, which affects the Oxygen.2 release. Bug: 528497 Change-Id: I57860c29c210568165276a123b855e462b6a107a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Config: Remove the include functionalityDavid Pursehouse2017-12-152-55/+8
| | | | | | | | | | | | | | | | | | | | | | | The Config class must be safe to run against untrusted input files. Reading arbitrary local system paths using include.path is risky for servers, including Gerrit Code Review. This was fixed on master [1] by making "readIncludedConfig" a noop by default. This allows only FileBasedConfig, which originated from local disk, to read local system paths. However, the "readIncludedConfig" method was only introduced in [2] which was needed by [3], both of which are only on the master branch. On the stable branch only Config supports includes. Therefore this commit simply disables the include functionality. [1] https://git.eclipse.org/r/#/c/113371/ [2] https://git.eclipse.org/r/#/c/111847/ [3] https://git.eclipse.org/r/#/c/111848/ Bug: 528781 Change-Id: I9a3be3f1d07c4b6772bff535a2556e699a61381c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* InMemoryRepository: Make inner class MemObjDatabase staticDavid Pursehouse2017-12-121-1/+1
| | | | | | | | | | | | | FindBugs reports: This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static. Change-Id: I9f49de32b4cd81b7ef1239b390353689263bf66e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* TransportCommand#setTimeout: Specify units for timeout in JavadocDavid Turner2017-12-121-1/+1
| | | | | Change-Id: Iadf0e2c6483794e43a5326f6be6bb34c19b00564 Signed-off-by: David Turner <dturner@twosigma.com>
* Fix typo in key of a JGitText externalized stringMatthias Sohn2017-12-113-3/+3
| | | | Change-Id: I0d22e24a0aa3b17339ef68849554f7c99b350dde Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix IllegalThreadStateException if stderr closed without exitingDmitry Pavlenko2017-12-103-6/+31
| | | | | | | | | | | | | If some process executed by FS#readPipe lived for a while after closing stderr, FS#GobblerThread#run failed with an IllegalThreadStateException exception when accessing p.exitValue() for the process which is still alive. Add Process#waitFor calls to wait for the process completion. Bug: 528335 Change-Id: I87e0b6f9ad0b995dbce46ddfb877e33eaf3ae5a6 Signed-off-by: Dmitry Pavlenko <pavlenko@tmatesoft.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* LfsServerText: Fix formatting of invalidPathInfo messageDavid Pursehouse2017-12-082-2/+2
| | | | | | | | | | | | | | | The message is formatted as: Invalid pathInfo '/abc' does not match '/{SHA-256}' but should be: Invalid pathInfo: '/abc' does not match '/{SHA-256}' (i.e. including a colon) to be consistent with other messages. Change-Id: Ic38aa7d33dd02d7954b95c331a73919a90c69991 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* InvalidLongObjectIdException: Fix formatting of messageDavid Pursehouse2017-12-082-2/+2
| | | | | | | | | | | | | The message is formatted as: Invalid id: : abcde... but should be: Invalid id: abcde... Change-Id: Ie15cacdcf2f168edaee262e6cf8061ebfe9d998d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* FileLfsServlet: Do not pretty print json responseDavid Pursehouse2017-12-082-7/+6
| | | | | | | | | | | | | | | | Pretty printing the response is useful for human readers, but most (if not all) of the time, the response will be read by programs. Remove it to avoid the additional overhead of the formatting and extra bytes in the response. Adjust the test accordingly. Note that LfsProtocolServlet already doesn't use pretty printing, so this change makes FileLfsServlet's behavior consistent. In fact, both classes now have duplicate Gson handling; this will be cleaned up in a separate change. Change-Id: I113a23403f9222f16e2c0ddf39461398b721d064 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* LfsStore: Make inner class AppServer staticDavid Pursehouse2017-12-061-1/+1
| | | | | | | | | | | | | FindBugs reports: This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static. Change-Id: I245e44678166176de0cfb275e22ddd159f88e0bd Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* DirCacheCheckout#processEntry: Fix typo in javadocDavid Pursehouse2017-12-061-1/+1
| | | | | Change-Id: Ie08a6275f4656ebb46abe8748b73b0fb52a98a35 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Prepare 4.9.2-SNAPSHOT buildsMatthias Sohn2017-12-0356-333/+333
| | | | Change-Id: I5879ad4aee94ff6783b5589728912117f2495dd3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* JGit v4.9.1.201712030800-rv4.9.1.201712030800-rMatthias Sohn2017-12-0356-59/+59
| | | | | Change-Id: I8bf477778c9dac41cb65233a9e7d590531a836b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Silence API warnings for reintroduced ResolveMerger#processEntryMatthias Sohn2017-12-031-0/+17
| | | | | | | | | | This was silenced before but suppression was unintentionally lost in merge commit 6858339c1e2878d5c5dc6cc9b422f9802be950ae. This method was removed in 4.9.0 and reintroduced in 4.9.1 to avoid breaking EMF compare versions which were built against older versions. See: abf420302bb03b119c19ddf29ef0c968f77c318d Change-Id: I152d58ac885e044bcab682b9423f6cc83b667989 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* GC: Delete stale temporary packs and indexesHector Caballero2017-11-242-0/+131
| | | | | | | | | | | | | | | When a GC operation is interrupted, temporary packs and indexes can be left on the pack folder. In big, busy repositories this can lead to significant amounts of wasted disk space if this interruption is done with a certain frequency. Remove stale temporary packs and indexes at the end of the GC process so they do not accumulate. To avoid interfering with a possible concurrent JGit GC process in the same repository, only delete temporary files that are older than one day. Change-Id: If9b6c1e57fac8a6a0ecc0a703089634caba4caae Signed-off-by: Hector Caballero <hector.caballero@ericsson.com>
* 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>
* | | | | 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>
* | | | | 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
* | | | | 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>
* | | | | | PackInserter: Implement newReader()Dave Borowitz2017-11-012-2/+351
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ib9e7f6439332eaed3d936f895a5271a7d514d3e9
* | | | | | Move some strings from DfsText to JGitTextDave Borowitz2017-11-015-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I60050e5127d12b6139d81859dba929fcfaabe504
* | | | | | FileRepository: Add pack-based inserter implementationDave Borowitz2017-11-013-0/+839
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications that use ObjectInserters to create lots of individual objects may prefer to avoid cluttering up the object directory with loose objects. Add a specialized inserter implementation that produces a single pack file no matter how many objects. This inserter is loosely based on the existing DfsInserter implementation, but is simpler since we don't need to buffer blocks in memory before writing to storage. An alternative for such applications would be to write out the loose objects and then repack just those objects later. This operation is not currently supported with the GC class, which always repacks existing packs when compacting loose objects. This in turn requires more CPU-intensive reachability checks and extra I/O to copy objects from old packs to new packs. So, the choice was between implementing a new variant of repack, or not writing loose objects in the first place. The latter approach is likely less code overall, and avoids unnecessary I/O at runtime. The current implementation does not yet support newReader() for reading back objects. Change-Id: I2074418f4e65853b7113de5eaced3a6b037d1a17
* | | | | | ObjectDirectory: Factor a method to close open pack handlesDave Borowitz2017-11-012-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I9490c4583fdf801de9c0bb09595ebb8fb4926988
* | | | | | ObjectDirectory: Remove last modified check in insertPackDave Borowitz2017-11-011-2/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GC explicitly handles the case where a new pack has the same name as an existing pack due to it containing the exact same set of objects. In this case, the pack passed to insertPack will have the same name as an existing pack, but it will also almost certainly have a later mtime than the existing pack. The loop in insertPack tried to short-circuit when inserting a new pack, to avoid walking more of the pack list than necessary. Unfortunately, this means it will never get to the check for an identical name, resulting in a duplicate entry for the same PackFile in the pack list. Remove the short-circuit so that insertPack does not insert a duplicate entry. Change-Id: I00711b28594622ad3bd104332334e8a3592cda7f
* | | | | Avoid bad rounding "1 year, 12 months" in date formatterMichael Keppler2017-10-232-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Round first, then calculate the labels. This avoids "x years, 12 months" and instead produces "x+1 years". One test case has been added for the original example the bug was found with, and one assertion has been moved from an existing test case to the new test case, since it also triggered the bug. Bug: 525907 Change-Id: I3270af3850c4fb7bae9123a0a6582f93055c9780 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | Ensure that ~ in ssh config is replaced before Jsch sees itThomas Wolf2017-10-182-21/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do tilde replacement for values from the ssh config file that are file names in all cases to make sure that they are already replaced when Jsch tries to get the values. Previously, OpenSshConfig did tilde replacement only for the IdentityFile in the JGit-facing "Host" interface and left the replacement in the Jsch-facing "Config" interface to Jsch. But on Windows the JGit notion of what should be used to replace the tilde differs from Jsch's replacement. Jsch always replaces the tilde by the value of the system property "user.home", whereas JGit also considers some environment variables like %HOME%. This can lead to rather surprising failures as in the case of bug 526175 where %HOME% != user.home. Prior to commit 9d24470 (i.e.,prior to JGit 4.9.0) this problem never occurred because Jsch was completely unaware of the ssh config file and all host and IdentityFile handling happened exclusively in JGit. Bug: 526175 Change-Id: I1511699664ffea07cb58ed751cfdb79b15e3a99e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | | Prepare 4.9.1-SNAPSHOT buildsMatthias Sohn2017-10-0856-333/+333
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ic49fd093d3fe4324c4d83aba74033040fcaa37a6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | JGit v4.9.0.201710071750-rv4.9.0.201710071750-rMatthias Sohn2017-10-0756-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I487f6aa3d0c4ef1d57f91cdc36177d994ae24c51 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | | | Terminate StreamCopy threads in case of errorsTill Brychcy2017-10-071-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - fix NPE: don't invoke close() if no exception happened. Bug: 513554 Change-Id: I29f9b2ac1607ee26521e8aba334facd20e4ad79c Signed-off-by: Till Brychcy <register.eclipse@brychcy.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>