diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java index 9b82c2afd..a85a4f49b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java @@ -1488,7 +1488,8 @@ public void testCommitTemplateConfig() String expectedTemplatePath = tempFile.getPath(); Config config = parse( - "[commit]\n\ttemplate = " + expectedTemplatePath + "\n"); + "[commit]\n\ttemplate = " + + Config.escapeValue(expectedTemplatePath) + "\n"); String templatePath = config.get(CommitConfig.KEY) .getCommitTemplatePath(); @@ -1537,7 +1538,8 @@ public void testCommitTemplateEncoding() JGitTestUtil.write(tempFile, templateContent); String expectedTemplatePath = tempFile.getPath(); config = parse("[i18n]\n\tcommitEncoding = utf-8\n" - + "[commit]\n\ttemplate = " + expectedTemplatePath + "\n"); + + "[commit]\n\ttemplate = " + + Config.escapeValue(expectedTemplatePath) + "\n"); assertEquals(templateContent, config.get(CommitConfig.KEY).getCommitTemplateContent(repo)); String commitEncoding = config.get(CommitConfig.KEY) @@ -1556,7 +1558,8 @@ public void testCommitTemplateWithInvalidEncoding() String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); config = parse("[i18n]\n\tcommitEncoding = invalidEcoding\n" - + "[commit]\n\ttemplate = " + tempFile.getPath() + "\n"); + + "[commit]\n\ttemplate = " + + Config.escapeValue(tempFile.getPath()) + "\n"); config.get(CommitConfig.KEY).getCommitTemplateContent(repo); } @@ -1570,7 +1573,7 @@ public void testCommitTemplateWithInvalidPath() String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); // commit message encoding - String expectedTemplatePath = "/nonExistingTemplate"; + String expectedTemplatePath = "~/nonExistingTemplate"; config = parse("[commit]\n\ttemplate = " + expectedTemplatePath + "\n"); String templatePath = config.get(CommitConfig.KEY) .getCommitTemplatePath();