summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
Commit message (Collapse)AuthorAgeFilesLines
* Add a command to deinitialize submodulesDavid Turner2017-12-271-0/+251
| | | | | Change-Id: Iaaefc2cbafbf083d6ab158b1c378ec69cc76d282 Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* URIish: support for empty portsMarc Strapetz2017-12-231-7/+16
| | | | | | | | Properly parse URLs like "ssh://host:/path" Bug: 519187 Change-Id: I0054868e30509e4ba919444be16c2a20f741545a Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* Merge branch 'stable-4.9'Matthias Sohn2017-12-233-0/+68
|\ | | | | | | | | | | | | | | * stable-4.9: Strings#convertGlob: fix escaping of patterns like [\[]. Change-Id: I18d55537002b3153db35f8a6b60f2f5317d17248 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Strings#convertGlob: fix escaping of patterns like [\[].Dmitry Pavlenko2017-12-213-0/+68
| | | | | | | | | | | | | | | | | | | | 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>
* | ConfigTest: Add some additional comment parsing testsDave Borowitz2017-12-211-0/+5
| | | | | | | | Change-Id: I0f1df93bd1ceeb847771ea6484f9de539e8c177b
* | Config: Drop backslash in invalid escape sequences in subsectionsDave Borowitz2017-12-211-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are ignored by C git when parsing: $ git config -f - --list <<EOF [foo "x\0y"] bar = baz [foo "x\qy"] bar = baz [foo "x\by"] bar = baz [foo "x\ny"] bar = baz [foo "x\ty"] bar = baz EOF foo.x0y.bar=baz foo.xqy.bar=baz foo.xby.bar=baz foo.xny.bar=baz foo.xty.bar=baz This behavior is different from value parsing, where an invalid escape sequence is an error (which JGit already does as well): $ git config -f - --list <<EOF [foo] bar = x\qy EOF fatal: bad config line 2 in standard input Change-Id: Ifd40129b37d9a62df3d886d8d7e22f766f54e9d1
* | Config: Match C git behavior more closely in escaping valuesDave Borowitz2017-12-212-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So this happened: $ git config -f foo.config foo.a 'x"y' $ git config -f foo.config foo.b x\\y $ git config -f foo.config foo.c $'x\ny' $ git config -f foo.config foo.d $'x\ty' $ git config -f foo.config foo.e $'x\by' $ cat foo.config [foo] a = x\"y b = x\\y c = x\ny d = x\ty e = y That last line is my shell interpreting the backspace byte: $ python -c 'print repr(open("foo.config").read())' '[foo]\n\ta = x\\"y\n\tb = x\\\\y\n\tc = x\\ny\n\td = x\\ty\n\te = x\x08y\n' Change-Id: I1b059e1afb544c39ddb587c07bf79a06e99d0a09
* | Fix remaining javadoc errors raised by doclintMatthias Sohn2017-12-216-22/+23
| | | | | | | | | | | | | | For now ignore doclint "missing" warnings. Change-Id: I0e5af7a757f4d92ffeeb113f30576a35414d6781 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-4.9'Dave Borowitz2017-12-201-3/+49
|\| | | | | | | | | | | | | | | * stable-4.9: PackInserter: Ensure objects are written at the end of the pack ObjectInserter: Add warning about mixing read-back with writes Change-Id: I308e7c1c6b72e8d4d9b5d0f4f51e9815fc92d7d7
| * PackInserter: Ensure objects are written at the end of the packDave Borowitz2017-12-201-3/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Config: Remove the include functionalityDavid Pursehouse2017-12-151-16/+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>
* | Config: Rewrite subsection and value escaping and parsingDave Borowitz2017-12-182-57/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, Config was using the same method for both escaping and parsing subsection names and config values. The goal was presumably code savings, but unfortunately, these two pieces of the git config format are simply different. In git v2.15.1, Documentation/config.txt says the following about subsection names: "Subsection names are case sensitive and can contain any characters except newline (doublequote `"` and backslash can be included by escaping them as `\"` and `\\`, respectively). Section headers cannot span multiple lines. Variables may belong directly to a section or to a given subsection." And, later in the same documentation section, about values: "A line that defines a value can be continued to the next line by ending it with a `\`; the backquote and the end-of-line are stripped. Leading whitespaces after 'name =', the remainder of the line after the first comment character '#' or ';', and trailing whitespaces of the line are discarded unless they are enclosed in double quotes. Internal whitespaces within the value are retained verbatim. Inside double quotes, double quote `"` and backslash `\` characters must be escaped: use `\"` for `"` and `\\` for `\`. The following escape sequences (beside `\"` and `\\`) are recognized: `\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB) and `\b` for backspace (BS). Other char escape sequences (including octal escape sequences) are invalid." The main important differences are that subsection names have a limited set of supported escape sequences, and do not support newlines at all, either escaped or unescaped. Arguably, it would be easy to support escaped newlines, but C git simply does not: $ git config -f foo.config $'foo.bar\nbaz.quux' value error: invalid key (newline): foo.bar baz.quux I468106ac was an attempt to fix one bug in escapeValue, around leading whitespace, without having to rewrite the whole escaping/parsing code. Unfortunately, because escapeValue was used for escaping subsection names as well, this made it possible to write invalid config files, any time Config#toText is called with a subsection name with trailing whitespace, like {foo }. Rather than pile hacks on top of hacks, fix it for real by largely rewriting the escaping and parsing code. In addition to fixing escape sequences, fix (and write tests for) a few more issues in the old implementation: * Now that we can properly parse it, always emit newlines as "\n" from escapeValue, rather than the weird (but still supported) syntax with a non-quoted trailing literal "\n\" before the newline. In addition to producing more readable output and matching the behavior of C git, this makes the escaping code much simpler. * Disallow '\0' entirely within both subsection names and values, since due to Unix command line argument conventions it is impossible to pass such values to "git config". * Properly preserve intra-value whitespace when parsing, rather than collapsing it all to a single space. Change-Id: I304f626b9d0ad1592c4e4e449a11b136c0f8b3e3
* | PushConnectionTest: Increase maxCommandBytes yet againDavid Pursehouse2017-12-181-1/+1
| | | | | | | | | | | | | | | | | | It was already increased in 61a943e and 661232b but is still not enough to take into account snapshot versions that are 100 or more commits ahead of tag, i.e. 4.9.2.201712150930-r.105-gc1d37ca27 Change-Id: Ibeff73adae06b92fe5bb9c5eced9e4c6a08c437c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | ConfigTest: Remove redundant assignmentDavid Pursehouse2017-12-151-2/+1
| | | | | | | | | | Change-Id: Ia913dbe6b7ad4b7000525fda8ca08cbc8dd87da6 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Make Config.readIncludedConfig a noop by defaultShawn Pearce2017-12-131-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. Return null by default to incide the include should be ignored. Only FileBasedConfig which originated from local disk should be trying to read local system paths. FileBasedConfig already overrides this method with its own implementation. Change-Id: I2ff31753868aa1bbac4a6843a4c23e50bd6f46f3
* | Merge "URIishTest: more Windows file-protocol tests"Thomas Wolf2017-12-091-0/+82
|\ \
| * | URIishTest: more Windows file-protocol testsMarc Strapetz2017-12-091-0/+82
| | | | | | | | | | | | | | | Change-Id: Id5fbd8bb9cd05da89d27e9532612d64ae84a55ba Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* | | PackInserterTest: Prevent potential NPE dereferencing Path.getFileName()David Pursehouse2017-12-081-3/+6
|/ / | | | | | | | | | | | | | | | | Path.getFileName() may return null if the path has zero elements. Enclose the dereference in a null-check. Change-Id: I7ea3d3f07edc13a80b593d28e8fd512a4e1ed56b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Use constants from StandardCharsets instead of hard-coded stringsDavid Pursehouse2017-12-0722-209/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of hard-coding the charset strings "US-ASCII", "UTF-8", and "ISO-8859-1", use the corresponding constants from StandardCharsets. UnsupportedEncodingException is not thrown when the StandardCharset constants are used, so remove the now redundant handling. Because the encoding names are no longer hard-coded strings, also remove redundant $NON-NLS warning suppressions. Also replace existing usages of the constants with static imports. Change-Id: I0a4510d3d992db5e277f009a41434276f95bda4e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | ConfigTest: Move pathToString to FileUtilsDavid Pursehouse2017-12-062-10/+3
| | | | | | | | | | | | | | | | | | | | | | ConfigTest#pathToString is not visible to FileBasedConfigTest when bulding with bazel. Move it to FileUtils rather than messing about with the bazel build rules to make it visible. Change-Id: Idcfd4822699dac9dc4a426088a929a9cd31bf53f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | FileBasedConfig: support for relative includesMarc Strapetz2017-12-042-3/+84
| | | | | | | | | | | | | | | | | | Relative include.path are now resolved against the config's parent directory. include.path starting with ~/ are resolved against the user's home directory Change-Id: I91911ef404126618b1ddd3589294824a0ad919e6 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* | ConfigTest: fix on WindowsMarc Strapetz2017-12-041-4/+12
| | | | | | | | | | Change-Id: I37a2ef611aef97faf1b891a9660c1745435a915d Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Make local assert methods private in test classesDavid Pursehouse2017-12-013-6/+6
| | | | | | | | | | Change-Id: I1bed28a1eac3c7f84cc40841853b9540c72be265 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Merge branch 'stable-4.9'Matthias Sohn2017-11-301-0/+106
|\| | | | | | | | | | | | | | | | | * stable-4.9: GC: Delete stale temporary packs and indexes Change-Id: I49b37845ee8a465404b801a2d8de0205a2e7ba30 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * GC: Delete stale temporary packs and indexesHector Caballero2017-11-241-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Break down DfsBlockCache stats by pack file extension.Minh Thai2017-11-272-5/+6
| | | | | | | | | | Change-Id: Iaecf0580279b33e3e2439784528cae7b69fb28bc Signed-off-by: Minh Thai <mthai@google.com>
* | Merge branch 'stable-4.9'David Pursehouse2017-11-221-2/+1
|\| | | | | | | | | | | | | | | * 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-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-0/+52
| | | | | | | | Change-Id: I468106acd2006d0a174c76dfd4bce231f1c7a6f8
* | Merge changes from topic 'includeDeletes'Shawn Pearce2017-11-161-0/+102
|\ \ | | | | | | | | | | | | | | | * 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-151-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | A tombstone will prevent a delayed reference update from resurrecting the deleted reference. Change-Id: Id9f4df43d435a299ff16cef614821439edef9b11 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>
* | Merge "ObjectDirectory: Add pack directory getter"David Pursehouse2017-11-146-9/+8
|\ \
| * | ObjectDirectory: Add pack directory getterHector Caballero2017-11-146-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ReftableCompactor should accept 0 for minUpdateIndexMinh Thai2017-11-141-0/+326
|/ / | | | | | | | | | | | | | | 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>
* | Remove an unused import from PackParserTestMatthias Sohn2017-11-111-1/+0
| | | | | | | | Change-Id: I4182a1746b09dedab648e457d1ece6d667a01f12 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge changes I22a8874b,I68ed4abd,I740bc4bf,Icbd17d15Jonathan Nieder2017-11-101-11/+94
|\ \ | | | | | | | | | | | | | | | | | | | | | * changes: BitmapWalker: do not revisit objects in bitmap Use bitmaps for non-commit reachability checks Make PackWriterBitmapWalker public UploadPackTest: construct commits in test method
| * | Use bitmaps for non-commit reachability checksJonathan Tan2017-11-101-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | 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-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Suppress "Unlikely argument type for equals()" warnings in testsDavid Pursehouse2017-11-063-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new warning was introduced in Eclipse 4.7 Oxygen [1]. The only instances of the warning are in test code that is asserting that some class does not compare equal to Strings. As in the Gerrit project [2] these asserts are arguably overkill, but arguably also a reasonable test of an equals implementation. Ignore the warning in these cases. Note that if the project is opened in an earlier version of Eclipse, a warning "Unsupported @SuppressWarnings" will be emitted. [1] https://www.eclipse.org/eclipse/news/4.7/M6/ [2] https://gerrit-review.googlesource.com/#/c/gerrit/+/110339/ Change-Id: I08ea33d71e6009cf0f37e6492a475931f447256b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Merge branch 'stable-4.9'David Pursehouse2017-11-021-0/+539
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: PackInserter: Implement newReader() Move some strings from DfsText to JGitText FileRepository: Add pack-based inserter implementation ObjectDirectory: Factor a method to close open pack handles ObjectDirectory: Remove last modified check in insertPack Change-Id: Ifc9ed6f5d8336bc978818a64eae122bceb933e5d
| * | PackInserter: Implement newReader()Dave Borowitz2017-11-011-1/+119
| | | | | | | | | | | | Change-Id: Ib9e7f6439332eaed3d936f895a5271a7d514d3e9
| * | FileRepository: Add pack-based inserter implementationDave Borowitz2017-11-011-0/+421
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Revert "Throw BinaryBlobException from RawParseUtils#lineMap."Han-Wen NIenhuys2017-10-242-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f2e64cd895a6aa4f18ab3b876f13b7814fb98f04. The newly added throws clause breaks backward compatibility. Change-Id: Ifa76a1b95935e52640b81cd53c171eb17da175c2 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* | | Throw BinaryBlobException from RawParseUtils#lineMap.Han-Wen Nienhuys2017-10-242-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | This makes detection of binaries exact for ResolveMerger and DiffFormatter: they will classify files as binary regardless of where the '\0' occurs in the text. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Id4342a199628d9406bfa04af1b023c27a47d4014
* | | Avoid loading and merging binary data in ResolveMergerHan-Wen Nienhuys2017-10-241-0/+142
| | | | | | | | | | | | | | | Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Ide4b68872d426aa262142f224acf636c776b35d3
* | | Introduce RawText#load.Han-Wen Nienhuys2017-10-241-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | This method creates a RawText from a blob, but avoids reading the blob if the start contains null bytes. This should reduce the amount of garbage that Gerrit produces for changes with binaries. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Idd202d20251f2d1653e5f1ca374fe644c2cf205f
* | | Merge branch 'stable-4.9'David Pursehouse2017-10-231-10/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Avoid bad rounding "1 year, 12 months" in date formatter Ensure that ~ in ssh config is replaced before Jsch sees it Change-Id: If6ca55f9447aaea3d7c2d36c03520d5e6dd5193e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | Avoid bad rounding "1 year, 12 months" in date formatterMichael Keppler2017-10-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>