Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse2016-02-05 08:36:05 +0000
committerDavid Pursehouse2016-02-05 08:36:05 +0000
commita176c6055aed2baa818b46e836f13d24b203b358 (patch)
treec0bea10e3303643699b8577984d043d6a5b387e1
parent8074f50b581cdb6cd9e3c189991caa0b8a56b7eb (diff)
downloadjgit-a176c6055aed2baa818b46e836f13d24b203b358.tar.gz
jgit-a176c6055aed2baa818b46e836f13d24b203b358.tar.xz
jgit-a176c6055aed2baa818b46e836f13d24b203b358.zip
ResetCommandTest: Use Git member in testHardResetAfterSquashMerge
Use the class member instance of the Git rather than creating a new one in the test. This makes it consistent with the other tests in the module. Change-Id: Ibe822ded76a80b94922e92bbc6f5d90bcc52f8a3 Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java
index 66f25e8e51..40d8458efd 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java
@@ -463,24 +463,24 @@ public class ResetCommandTest extends RepositoryTestCase {
@Test
public void testHardResetAfterSquashMerge() throws Exception {
- Git g = new Git(db);
+ git = new Git(db);
writeTrashFile("file1", "file1");
- g.add().addFilepattern("file1").call();
- RevCommit first = g.commit().setMessage("initial commit").call();
+ git.add().addFilepattern("file1").call();
+ RevCommit first = git.commit().setMessage("initial commit").call();
assertTrue(new File(db.getWorkTree(), "file1").exists());
createBranch(first, "refs/heads/branch1");
checkoutBranch("refs/heads/branch1");
writeTrashFile("file2", "file2");
- g.add().addFilepattern("file2").call();
- g.commit().setMessage("second commit").call();
+ git.add().addFilepattern("file2").call();
+ git.commit().setMessage("second commit").call();
assertTrue(new File(db.getWorkTree(), "file2").exists());
checkoutBranch("refs/heads/master");
- MergeResult result = g.merge()
+ MergeResult result = git.merge()
.include(db.exactRef("refs/heads/branch1"))
.setSquash(true)
.call();
@@ -489,7 +489,7 @@ public class ResetCommandTest extends RepositoryTestCase {
result.getMergeStatus());
assertNotNull(db.readSquashCommitMsg());
- assertSameAsHead(g.reset().setMode(ResetType.HARD)
+ assertSameAsHead(git.reset().setMode(ResetType.HARD)
.setRef(first.getName()).call());
assertNull(db.readSquashCommitMsg());

Back to the top