aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-02-10 00:50:41 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2016-02-10 00:51:01 +0100
commit28e2fed761f0ddf01029c999b299ed0bccdf630e (patch)
treef7878683e3aef308a939015091c978bff2488431 /org.eclipse.jgit.pgm.test
parentc901cd89d35fe2cc014c7e0f5849e32a14fe679a (diff)
parent26012958a35d85639fe44fdbd4690cb58ec3b836 (diff)
downloadjgit-28e2fed761f0ddf01029c999b299ed0bccdf630e.tar.gz
jgit-28e2fed761f0ddf01029c999b299ed0bccdf630e.zip
Merge branch 'stable-4.2'
* stable-4.2: RepoProject: Fix warnings about variable hiding RepoTest: Open Git in try-with-resources RepositoryResolveTest: Open Git in try-with-resource RepositoryTestCase: Open autocloseable types in try-with-resource ResetCommandTest: Use Git member in testHardResetAfterSquashMerge ResolveMergerTest: Open Git in try-with-resource RevCommitListTest: Open Git and RevWalk in try-with-resource RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource RevObjectTest: Open RevWalk in try-with-resource RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource RevertCommandTest: Open Git in try-with-resource SquashMessageFormatterTest: Open git in try-with-resource StatusCommandTest: Open Git in try-with-resource SubmoduleAddTest: Open Git in try-with-resource SymlinksTest: Open git and TreeWalk in try-with-resource T0003_BasicTest: Open autocloseable types in try-with-resource TextHashFunctions: Fix warnings about variable hiding TreeFilterTest: Open TreeWalk in try-with-resource TreeWalkJava7Test: Open TreeWalk in try-with-resource Fix diff for added and removed submodule Change-Id: If3ecc63f6dfac55474d3c1dd2f4105371f3d24fb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm.test')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/RepoTest.java36
1 files changed, 20 insertions, 16 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/RepoTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/RepoTest.java
index 0eee771d2c..ba62383b3d 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/RepoTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/RepoTest.java
@@ -74,28 +74,32 @@ public class RepoTest extends CLIRepositoryTestCase {
super.setUp();
defaultDb = createWorkRepository();
- Git git = new Git(defaultDb);
- JGitTestUtil.writeTrashFile(defaultDb, "hello.txt", "world");
- git.add().addFilepattern("hello.txt").call();
- git.commit().setMessage("Initial commit").call();
+ try (Git git = new Git(defaultDb)) {
+ JGitTestUtil.writeTrashFile(defaultDb, "hello.txt", "world");
+ git.add().addFilepattern("hello.txt").call();
+ git.commit().setMessage("Initial commit").call();
+ }
notDefaultDb = createWorkRepository();
- git = new Git(notDefaultDb);
- JGitTestUtil.writeTrashFile(notDefaultDb, "world.txt", "hello");
- git.add().addFilepattern("world.txt").call();
- git.commit().setMessage("Initial commit").call();
+ try (Git git = new Git(notDefaultDb)) {
+ JGitTestUtil.writeTrashFile(notDefaultDb, "world.txt", "hello");
+ git.add().addFilepattern("world.txt").call();
+ git.commit().setMessage("Initial commit").call();
+ }
groupADb = createWorkRepository();
- git = new Git(groupADb);
- JGitTestUtil.writeTrashFile(groupADb, "a.txt", "world");
- git.add().addFilepattern("a.txt").call();
- git.commit().setMessage("Initial commit").call();
+ try (Git git = new Git(groupADb)) {
+ JGitTestUtil.writeTrashFile(groupADb, "a.txt", "world");
+ git.add().addFilepattern("a.txt").call();
+ git.commit().setMessage("Initial commit").call();
+ }
groupBDb = createWorkRepository();
- git = new Git(groupBDb);
- JGitTestUtil.writeTrashFile(groupBDb, "b.txt", "world");
- git.add().addFilepattern("b.txt").call();
- git.commit().setMessage("Initial commit").call();
+ try (Git git = new Git(groupBDb)) {
+ JGitTestUtil.writeTrashFile(groupBDb, "b.txt", "world");
+ git.add().addFilepattern("b.txt").call();
+ git.commit().setMessage("Initial commit").call();
+ }
resolveRelativeUris();
}