aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit/src
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-05-20 11:28:21 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2016-05-31 00:11:11 +0200
commit4c236ff4bbf664fd177a33f42517b0eef52510c8 (patch)
treef4bec49bded5342a3be25c271a5a910751ce63d4 /org.eclipse.jgit.junit/src
parentbfebe6ae4bf50250eca20b7c6bea0d06e771a817 (diff)
downloadjgit-4c236ff4bbf664fd177a33f42517b0eef52510c8.tar.gz
jgit-4c236ff4bbf664fd177a33f42517b0eef52510c8.zip
Replace use of deprecated method Repository.getRef()
Change-Id: Iecf2b8deafc4991cc3333702fb9fa0638be7b914 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
index 86b87b4075..c282df03bd 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
@@ -406,7 +406,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
String originalBranch = repo.getFullBranch();
boolean empty = repo.resolve(Constants.HEAD) == null;
if (!empty) {
- if (repo.getRef(branch) == null)
+ if (repo.findRef(branch) == null)
git.branchCreate().setName(branch).call();
git.checkout().setName(branch).call();
}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index 07df56d3f1..25e313cee6 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -501,7 +501,7 @@ public class TestRepository<R extends Repository> {
*/
public CommitBuilder amendRef(String ref) throws Exception {
String name = normalizeRef(ref);
- Ref r = db.getRef(name);
+ Ref r = db.exactRef(name);
if (r == null)
throw new IOException("Not a ref: " + ref);
return amend(pool.parseCommit(r.getObjectId()), branch(name).commit());
@@ -703,7 +703,7 @@ public class TestRepository<R extends Repository> {
RevCommit parent = commit.getParent(0);
pool.parseHeaders(parent);
- Ref headRef = db.getRef(Constants.HEAD);
+ Ref headRef = db.exactRef(Constants.HEAD);
if (headRef == null)
throw new IOException("Missing HEAD");
RevCommit head = pool.parseCommit(headRef.getObjectId());
@@ -1025,7 +1025,7 @@ public class TestRepository<R extends Repository> {
CommitBuilder(BranchBuilder b) throws Exception {
branch = b;
- Ref ref = db.getRef(branch.ref);
+ Ref ref = db.exactRef(branch.ref);
if (ref != null && ref.getObjectId() != null)
parent(pool.parseCommit(ref.getObjectId()));
}