Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-05-21 06:57:06 -0400
committerThomas Wolf2016-05-22 16:47:10 -0400
commit118f42f3321c2aa9e98c1e5d388d43950865b877 (patch)
treea8a82b0c7428e02a57ae7b3f4b516d4a7d0d894c /org.eclipse.egit.core.test/src
parent4d4255306b7ba22ef61d8144179281b8d209c3a0 (diff)
downloadegit-118f42f3321c2aa9e98c1e5d388d43950865b877.tar.gz
egit-118f42f3321c2aa9e98c1e5d388d43950865b877.tar.xz
egit-118f42f3321c2aa9e98c1e5d388d43950865b877.zip
Replace uses of deprecated Repository.getRef()
Use Repository.findRef() or Repository.exactRef(), as appropriate. No functional change. Change-Id: Ie481c7fa5ac69d4778cf9f70ac2b019bee6e53c9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.core.test/src')
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java4
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/RebaseOperationTest.java21
2 files changed, 11 insertions, 14 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
index 1eccf133f..af3e9c160 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
@@ -310,7 +310,7 @@ public class TestRepository {
throws IOException {
RefUpdate updateRef;
updateRef = repository.updateRef(newRefName);
- Ref startRef = repository.getRef(refName);
+ Ref startRef = repository.findRef(refName);
ObjectId startAt = repository.resolve(refName);
String startBranch;
if (startRef != null)
@@ -462,7 +462,7 @@ public class TestRepository {
if (dc == null)
return true;
- Ref ref = repository.getRef(Constants.HEAD);
+ Ref ref = repository.exactRef(Constants.HEAD);
try (RevWalk rw = new RevWalk(repository)) {
RevCommit c = rw.parseCommit(ref.getObjectId());
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/RebaseOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/RebaseOperationTest.java
index 478a76107..830a09adf 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/RebaseOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/RebaseOperationTest.java
@@ -82,9 +82,8 @@ public class RebaseOperationTest extends GitTestCase {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(
- testRepository.getRepository(), testRepository.getRepository()
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(testRepository.getRepository(),
+ testRepository.getRepository().exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -127,9 +126,8 @@ public class RebaseOperationTest extends GitTestCase {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(
- testRepository.getRepository(), testRepository.getRepository()
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(testRepository.getRepository(),
+ testRepository.getRepository().exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -172,9 +170,8 @@ public class RebaseOperationTest extends GitTestCase {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(
- testRepository.getRepository(), testRepository.getRepository()
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(testRepository.getRepository(),
+ testRepository.getRepository().exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -220,8 +217,8 @@ public class RebaseOperationTest extends GitTestCase {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(repository, repository
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(repository,
+ repository.exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -230,7 +227,7 @@ public class RebaseOperationTest extends GitTestCase {
try {
// let's try to start again, we should get a wrapped
// WrongRepositoryStateException
- op = new RebaseOperation(repository, repository.getRef(MASTER));
+ op = new RebaseOperation(repository, repository.exactRef(MASTER));
op.execute(null);
fail("Expected Exception not thrown");
} catch (CoreException e) {

Back to the top