diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2016-10-23 19:18:37 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2016-10-23 19:18:38 -0400 |
commit | 88f433be84e27468d9234b0305b97139d593c8a9 (patch) | |
tree | 09d4a9b5953a397fb6d9fab6c452e463c3c97771 | |
parent | f30c05fc74424b72a8637be67d74ce14ea56d769 (diff) | |
parent | a5eccf4a4d25534da73d39416454ab243531865a (diff) | |
download | jgit-88f433be84e27468d9234b0305b97139d593c8a9.tar.gz jgit-88f433be84e27468d9234b0305b97139d593c8a9.zip |
Merge "Preserve backslashes within double quotes in CLIGitCommand::split()"
-rw-r--r-- | org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java | 2 | ||||
-rw-r--r-- | org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CLIGitCommandTest.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java index 3f396563c2..6a0a233806 100644 --- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java +++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java @@ -218,7 +218,7 @@ public class CLIGitCommand extends Main { inquote = !inquote; continue; case '\\': - if (inquote || ip == commandLine.length()) + if (inDblQuote || inquote || ip == commandLine.length()) r.append(b); // literal within a quote else r.append(commandLine.charAt(ip++)); diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CLIGitCommandTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CLIGitCommandTest.java index 24788a47bd..58d8e0349f 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CLIGitCommandTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CLIGitCommandTest.java @@ -51,9 +51,11 @@ public class CLIGitCommandTest { @Test public void testSplit() throws Exception { + assertArrayEquals(new String[0], split("")); assertArrayEquals(new String[] { "a" }, split("a")); assertArrayEquals(new String[] { "a", "b" }, split("a b")); assertArrayEquals(new String[] { "a", "b c" }, split("a 'b c'")); assertArrayEquals(new String[] { "a", "b c" }, split("a \"b c\"")); + assertArrayEquals(new String[] { "a", "b\\c" }, split("a \"b\\c\"")); } } |