diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2023-08-29 21:26:34 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2023-08-29 21:26:34 +0200 |
commit | e29834a77da41625bd48ebf0538ee016a5319b7b (patch) | |
tree | c8511bb0c0d04660887f90d4c1192d310de1ac95 /org.eclipse.jgit.test | |
parent | a2f326b76200c8def03eb136811c2cb5bc304f89 (diff) | |
download | jgit-e29834a77da41625bd48ebf0538ee016a5319b7b.tar.gz jgit-e29834a77da41625bd48ebf0538ee016a5319b7b.zip |
Fix some tests in ConfigTest
Some of the ConfigTest tests created a FileRepositoryBuilder but didn't
use it to actually create a FileRepository.
Change-Id: I1a4b27891daee1b235a71e7bbf2a7588b9d11a53
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java | 16 |
1 files changed, 12 insertions, 4 deletions
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 8f9d105319..36cf77bb01 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 @@ -1482,7 +1482,9 @@ public class ConfigTest { File workTree = tmp.newFolder("dummy-worktree"); File tempFile = tmp.newFile("testCommitTemplate-"); - Repository repo = FileRepositoryBuilder.create(workTree); + Repository repo = FileRepositoryBuilder + .create(new File(workTree, ".git")); + repo.create(); String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); String expectedTemplatePath = tempFile.getPath(); @@ -1532,7 +1534,9 @@ public class ConfigTest { throws ConfigInvalidException, IOException { Config config = new Config(null); File workTree = tmp.newFolder("dummy-worktree"); - Repository repo = FileRepositoryBuilder.create(workTree); + Repository repo = FileRepositoryBuilder + .create(new File(workTree, ".git")); + repo.create(); File tempFile = tmp.newFile("testCommitTemplate-"); String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); @@ -1554,7 +1558,9 @@ public class ConfigTest { Config config = new Config(null); File workTree = tmp.newFolder("dummy-worktree"); File tempFile = tmp.newFile("testCommitTemplate-"); - Repository repo = FileRepositoryBuilder.create(workTree); + Repository repo = FileRepositoryBuilder + .create(new File(workTree, ".git")); + repo.create(); String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); config = parse("[i18n]\n\tcommitEncoding = invalidEcoding\n" @@ -1569,7 +1575,9 @@ public class ConfigTest { Config config = new Config(null); File workTree = tmp.newFolder("dummy-worktree"); File tempFile = tmp.newFile("testCommitTemplate-"); - Repository repo = FileRepositoryBuilder.create(workTree); + Repository repo = FileRepositoryBuilder + .create(new File(workTree, ".git")); + repo.create(); String templateContent = "content of the template"; JGitTestUtil.write(tempFile, templateContent); // commit message encoding |