diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2019-07-24 20:36:51 +0200 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2019-07-25 08:12:08 +0200 |
commit | 5fe455c84f25eda70094b75f23251a2e8d525594 (patch) | |
tree | c86e9b9ae99aae1f89e07b7bd9d91bf97414f9e8 /org.eclipse.jgit.pgm.test/src/org/eclipse | |
parent | 81acf3b44025eb36bc29b2a5de3fedc657f1bc10 (diff) | |
download | jgit-5fe455c84f25eda70094b75f23251a2e8d525594.tar.gz jgit-5fe455c84f25eda70094b75f23251a2e8d525594.zip |
JGit pgm tests must quote paths on the command line
The JGit pgm tests parse the command line internally using Linux
semantics, treating '\' as an escape. File paths therefore must
be quoted, otherwise Windows paths are destroyed. See the
attachment[1] on bug 548598.
[1] https://bugs.eclipse.org/bugs/attachment.cgi?id=279387
Bug: 544326
Change-Id: If42e29c8e808b0983fba2843a34c3ea3dd0e9246
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.pgm.test/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java index a830ff2849..befb7f62ac 100644 --- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java +++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java @@ -211,6 +211,14 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase { .replaceAll("\t", "\\\\t"); } + protected String shellQuote(String s) { + return "'" + s.replace("'", "'\\''") + "'"; + } + + protected String shellQuote(File f) { + return "'" + f.getPath().replace("'", "'\\''") + "'"; + } + protected void assertStringArrayEquals(String expected, String[] actual) { // if there is more than one line, ignore last one if empty assertEquals(1, |