aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge changes Id616611e,Ib6509e81,I52f5d3f2David Pursehouse2018-02-221-33/+154
|\ | | | | | | | | | | | | * changes: RepoCommand: generate relative submodule URLs from absolute URLs. RepoCommand: don't record new commit if tree did not change RepoCommand: persist unreadable submodules in .gitmodules
| * RepoCommand: generate relative submodule URLs from absolute URLs.Han-Wen Nienhuys2018-02-211-0/+58
| | | | | | | | | | | | | | | | If a manifest file specifies an absolute URL on the same host on which the superproject resides, rewrite the URLs to be relative. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Id616611e5195998fb665c8e7806539a3a02e219a
| * RepoCommand: don't record new commit if tree did not changeHan-Wen Nienhuys2018-02-191-2/+54
| | | | | | | | | | Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Ib6509e816684256d723558d5e8f3c37de58a2ff8
| * RepoCommand: persist unreadable submodules in .gitmodulesHan-Wen Nienhuys2018-02-191-33/+44
| | | | | | | | | | | | | | | | | | | | | | | | In cases where a manifest file mixes different remotes, a Gerrit server process may not have access to all remotes, and won't be able to produce a full submodule tree. Preserving this information in .gitmodules will let downstream clients reconstruct the full tree. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: I52f5d3f288e771dca0af2b4dd3f3fa0f940dcf15
* | CGitIgnoreTest: also test untracked filesMarc Strapetz2018-02-211-5/+30
|/ | | | | Change-Id: I21a4ebd63eaaa85aa2e68f99ef58c141189bdab4 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* Merge "Merge branch 'stable-4.10'"Matthias Sohn2018-02-142-0/+287
|\
| * Merge branch 'stable-4.10'Matthias Sohn2018-02-142-0/+287
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Fix ssh host name handling for Jsch Jsch overrides the port in the URI with the one in ~/.ssh/config Change-Id: I860fc61ceb12ae792b1ee7421046ecd32373b9f8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | * Merge branch 'stable-4.9' into stable-4.10Matthias Sohn2018-02-142-0/+287
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Fix ssh host name handling for Jsch Jsch overrides the port in the URI with the one in ~/.ssh/config Change-Id: Iff9076f65e767bbe8df016337b631bdaeb40ad98 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| | | * Fix ssh host name handling for JschThomas Wolf2018-02-141-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we give Jsch access to the ssh config file, we must _not_ resolve the host name from the alias. Instead we must give the alias (i.e., the host name as is in the URI) to Jsch, so that it finds the same ssh config entry. Otherwise if the hostname in the URI, which is taken as an alias in ssh config ("Host" line), is unequal to the "Hostname" line, and there happens to be another ssh config entry with that translated host name as alias, Jsch will pick up that second entry, and we end up with a strange mixture of both. Add tests for this case. Bug: 531118 Change-Id: I249d8c073b0190ed110a69dca5b9be2a749822c3 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| | | * Jsch overrides the port in the URI with the one in ~/.ssh/configThomas Wolf2018-02-142-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jsch unconditionally overwrites the port from the ssh config file (if a port is specified there), even if the URI explicitly does give a different port. Fix this, and add tests. Change-Id: I7b014543c7ece26270e366db39d7647f82d64f0d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | | InitCommand: Don't leave Repository open after Git is closedDavid Pursehouse2018-02-141-36/+41
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The InitCommand returns a Git that is instantiated with the newly created Repository, but the Repository is not closed with the Git resulting in resource leaks. Create the Git with `closeRepo` set to true, such that the Repository is also closed when the Git is closed. Adjust the tests to use try-with-resource on the Git instance. Change-Id: Ib26e7428c7d8840956d1edb09e53b93e23e6fe5a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | URIish: add a test for equals and hashcode methodsMatthias Sohn2018-02-131-0/+28
| | | | | | | | | | | | Change-Id: I5727ac1757dca0d63631401bcb074ee8f58ce082 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Add a minimum negotiation feature for fetchTerry Parker2018-02-121-3/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android an Chrome have several repos with >300k refs. We sometimes see negotiations of >100k rounds. This change provides a "minimal negotiation" feature on the client side that limits how many "have" lines the client sends. The client extracts the current SHA-1 values for the refs in its wants set, and terminates negotiation early when all of those values have been sent as haves. If a new branch is being fetched then that set will be empty and the client will terminate after current default minimum of two rounds. This feature is gated behind a "fetch.useminimalnegotiation" configuration flag, which defaults to false. Change-Id: Ib12b095cac76a59da6e8f72773c4129e3b32ff2b Signed-off-by: Terry Parker <tparker@google.com>
* | | MergedReftable to skip shadowed refs in same reftableMinh Thai2018-02-091-0/+21
| | | | | | | | | | | | | | | | | | | | | This would allow compact and GC process to clean up duplicate ref names in the reftables. Change-Id: I2b9df0bf72dba63cc3525e374982e60559a776c2 Signed-off-by: Minh Thai <mthai@google.com>
* | | Fix CleanCommand not to throw FileNotFoundExceptionsChristian Halstrick2018-02-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CleanCommand is collecting the files and folders to be deleted it may happen that the list of directories contains obsolete entries. E.g. a folder and its parent folder may be in the list. Only the parent folder would be sufficient. This was a reason for hitting FileNotFoundExceptions when finally trying to delete the files and folders. Improve CleanCommand to ignore files to be deleted which are already gone. Bug: 514434 Change-Id: I10caa01bfb9cec5967dfdaea50c6e4a713eeeabd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | GC: Remove empty references foldersHector Caballero2018-02-071-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After packaging references, the folders containing these references are not deleted. In a busy repository, this causes operations to slow down as traversing the references tree becomes longer. Delete empty reference folders after the loose references have been packed. To avoid deleting a folder that was just created by another concurrent operation, only delete folders that were not modified in the last 30 seconds. Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com> Change-Id: Ie79447d6121271cf5e25171be377ea396c7028e0
* | | Basic submodule merge handlingDavid Turner2018-02-042-2/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't handle the really hard thing, which is merging spurious conflicts inside .gitmodules files. That's OK: git.git doesn't either. Users can resolve the conflict themselves and then commit the merge. Previously, jgit would crash when attempting to merge conflicting submodule changes. Even if there was no conflict, after a merge which adds submodules, the repository would have been missing empty directories for newly-added submodules. This patch fixes the crash, and adds the empty directories where necessary. It ensures that the index is in a conflicted state when submodule changes conflict. Reported-by: Alexey Korobkov Bug: 494551 Change-Id: I79db6798c2bdcc1159b5b2589b02da198dc906a1 Signed-off-by: David Turner <dturner@twosigma.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix index blob for merges with CRLF translationsThomas Wolf2018-02-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit fc7d407 corrected line endings for working tree files resulting from merges when CRLF translations are to be done. However, that also resulted in the file content being put as-is into the index, which is wrong. The index must contain the file content with reverse CRLF translations applied. With core.autocrlf=true, the working tree file should have CR-LF, but the index blob must still contain only LF. Fix this oversight and apply the inverse translation when updating the index, similar to what is done in AddCommand. Bug: 499615 Change-Id: I3a33931318bdb580b2390f3450f91ea8f258a6a4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Fix version of slf4j in manifest filesDavid Pursehouse2018-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Consistently require 1.7.0. We ship 1.7.2 with our p2 repository but there is no need to require 1.7.2 since it should be API compatible with 1.7.0. Change-Id: I8467bb14316cb24daa79e89275332107d2716190 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Honor CRLF settings when writing merge resultsThomas Wolf2018-02-021-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merges are performed using the raw text as stored in the git repository. When we write the merge result, we must apply the correct CRLF settings. Otherwise the line endings in the result will be wrong. Bug: 499615 Change-Id: I37a9b987e9404c97645d2720cd1c7c04c076a96b Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Minor improvements in git config file inclusionsThomas Wolf2018-01-281-2/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Section and key names in git config files are case-insensitive. * If an include directive is invalid, include the line in the exception message. * If inclusion of the included file fails, put the file name into the exception message so that the user knows in which file the problem is. Change-Id: If920943af7ff93f5321b3d315dfec5222091256c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | | Merge branch 'stable-4.10'Matthias Sohn2018-01-131-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.10: Revert handling of ssh IdentityFile to pre-4.9 behavior Prepare 4.10.1-SNAPSHOT builds JGit v4.10.0.201712302008-r Change-Id: I13797f064de919c257feb8e96da226d7b1faaf7a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge branch 'stable-4.9' into stable-4.10Matthias Sohn2018-01-131-1/+2
| |\| | | | | | | | | | | | | | | | | | | * stable-4.9: Revert handling of ssh IdentityFile to pre-4.9 behavior Change-Id: I7cd2f0fe93be5193d6de2a376a023bdece5d84a9
| | * Revert handling of ssh IdentityFile to pre-4.9 behaviorThomas Wolf2018-01-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jsch caches keys (aka identities) specified in ~/.ssh/config via IndentityFile only for the current Jsch Session. This results in multiple password prompts for successive sessions. Do the handling of IdentityFile exclusively in JGit, as it was before 4.9. JGit uses different Jsch instances per host and caches the IdentityFile there, allowing it to be re-used in different sessions for the same host. * Add comments to explain this. * Move the JschBugFixingConfig from OpenSshConfig to JschConfigSessionFactory to have all these Jsch work-arounds in one place. * Make that config hide the IdentityFile config from Jsch to avoid that Jsch overrides the JGit behavior. Bug: 529173 Change-Id: Ib36c34a2921ba736adeb64de71323c2b91151613 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * | Prepare 4.10.1-SNAPSHOT buildsMatthias Sohn2017-12-312-47/+47
| | | | | | | | | | | | | | | Change-Id: I139fb660c4630d9d073eabf37ff26ea3a823bcbd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v4.10.0.201712302008-rv4.10.0.201712302008-rMatthias Sohn2017-12-312-2/+2
| | | | | | | | | | | | | | | Change-Id: I9cc3a839d906acd01829df1de64cfafca8a6d008 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | PackInserterTest#newLargeBlob: Factor Random instance out to class memberDavid Pursehouse2018-01-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of instantiating a new Random on each invocation of newLargeBlob, create it once and reuse it. This fixes a warning raised by Spotbugs about the Random object being created and only used once. Change-Id: I5b8e6ccbbc92641811537808aed9eae2034c1133 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | | Prepare 4.11.0-SNAPSHOT buildsMatthias Sohn2017-12-312-47/+47
|/ / | | | | | | | | Change-Id: I5d5e2befcf530d93457d44684bd9e4fc2392e5eb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | 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>
* | Add header Automatic-Module-Name for Java 9Karsten Thoms2017-12-231-0/+1
| | | | | | | | | | | | Bug: 529075 Change-Id: I4532ce2c80eb91531d46026676502d636ccda706 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.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
| * Prepare 4.9.3-SNAPSHOT buildsMatthias Sohn2017-12-162-47/+47
| | | | | | | | | | Change-Id: Ife3f2b0b5407227f89ded42358adbf01d53e14cf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.9.2.201712150930-rv4.9.2.201712150930-rMatthias Sohn2017-12-152-2/+2
| | | | | | | | | | Change-Id: I013964045d532659a4be3b81d6612b59bc9ffb14 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * 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>
| * Prepare 4.9.2-SNAPSHOT buildsMatthias Sohn2017-12-032-47/+47
| | | | | | | | Change-Id: I5879ad4aee94ff6783b5589728912117f2495dd3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v4.9.1.201712030800-rv4.9.1.201712030800-rMatthias Sohn2017-12-032-2/+2
| | | | | | | | | | Change-Id: I8bf477778c9dac41cb65233a9e7d590531a836b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.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>