Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-03-16 17:45:17 -0400
committerThomas Wolf2019-03-16 17:45:17 -0400
commitb385340dae9e2b715fe8e10e3c98ed5c698e28bf (patch)
tree295a763ae428d18b06179d8d4e3760794d9f70c9 /org.eclipse.egit.core.test/src
parentdf545e2b32e999d98b8f9240360744491a2797c4 (diff)
downloadegit-b385340dae9e2b715fe8e10e3c98ed5c698e28bf.tar.gz
egit-b385340dae9e2b715fe8e10e3c98ed5c698e28bf.tar.xz
egit-b385340dae9e2b715fe8e10e3c98ed5c698e28bf.zip
Replace usages of deprecated Repository methods
getTags() and peel() are deprecated; replace by equivalent other methods. Change-Id: I1edc2ff88f0f79ea3749a53bf89ffac46d4b4c62 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/op/TagOperationTest.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java
index 41a51506d..ae1ecbd12 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java
@@ -24,7 +24,6 @@ import org.eclipse.egit.core.test.DualRepositoryTestCase;
import org.eclipse.egit.core.test.TestRepository;
import org.eclipse.egit.core.test.TestUtils;
import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.TagBuilder;
import org.eclipse.jgit.revwalk.RevTag;
import org.eclipse.jgit.revwalk.RevWalk;
@@ -68,7 +67,7 @@ public class TagOperationTest extends DualRepositoryTestCase {
@Test
public void addTag() throws Exception {
assertTrue("Tags should be empty", repository1.getRepository()
- .getTags().isEmpty());
+ .getRefDatabase().getRefsByPrefix(Constants.R_TAGS).isEmpty());
TagBuilder newTag = new TagBuilder();
newTag.setTag("TheNewTag");
newTag.setMessage("Well, I'm the tag");
@@ -79,7 +78,7 @@ public class TagOperationTest extends DualRepositoryTestCase {
newTag, false);
top.execute(new NullProgressMonitor());
assertFalse("Tags should not be empty", repository1.getRepository()
- .getTags().isEmpty());
+ .getRefDatabase().getRefsByPrefix(Constants.R_TAGS).isEmpty());
try {
top.execute(null);
@@ -95,17 +94,16 @@ public class TagOperationTest extends DualRepositoryTestCase {
} catch (CoreException e) {
// expected
}
- Ref tagRef = repository1.getRepository().getTags().get("TheNewTag");
try (RevWalk walk = new RevWalk(repository1.getRepository())) {
RevTag tag = walk.parseTag(repository1.getRepository().resolve(
- tagRef.getName()));
+ Constants.R_TAGS + "TheNewTag"));
newTag.setMessage("Another message");
assertFalse("Messages should differ",
tag.getFullMessage().equals(newTag.getMessage()));
top.execute(null);
tag = walk.parseTag(repository1.getRepository().resolve(
- tagRef.getName()));
+ Constants.R_TAGS + "TheNewTag"));
assertTrue("Messages be same",
tag.getFullMessage().equals(newTag.getMessage()));
walk.dispose();

Back to the top