diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-05-23 13:31:22 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-05-23 13:31:22 +0900 |
commit | 1f6d43a6528212f270f0f4542ee0cb54cd1a2435 (patch) | |
tree | aa6ed9c3892e4b85e70800575b51b69e504ed394 /org.eclipse.jgit.test | |
parent | d369b61852d4ab099067de0e38dc117ee41e47ef (diff) | |
download | jgit-1f6d43a6528212f270f0f4542ee0cb54cd1a2435.tar.gz jgit-1f6d43a6528212f270f0f4542ee0cb54cd1a2435.zip |
Fix trivial usages of deprecated Repository#getAllRefs
Callers of getAllRefs that only iterate over the `values()` of the
returned map can be trivially fixed to call getRefDatabase().getRefs()
instead.
Only fix those where the calling method is already declared to throw
IOException, to avoid potential API changes.
Change-Id: I2b05f785077a1713953cfd42df7bf915f889f90b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
3 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java index 1af37e25f5..ca86d81301 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java @@ -245,7 +245,7 @@ public class PushCommandTest extends RepositoryTestCase { git.add().addFilepattern("f" + i).call(); commit = git.commit().setMessage("adding f" + i).call(); git.push().setRemote("test").call(); - git2.getRepository().getAllRefs(); + git2.getRepository().getRefDatabase().getRefs(); assertEquals("failed to update on attempt " + i, commit.getId(), git2.getRepository().resolve("refs/heads/test")); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java index 5b567d00f7..bfa30d5b4b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java @@ -972,7 +972,7 @@ public class DfsGarbageCollectorTest { private static boolean isReachable(Repository repo, AnyObjectId id) throws IOException { try (RevWalk rw = new RevWalk(repo)) { - for (Ref ref : repo.getAllRefs().values()) { + for (Ref ref : repo.getRefDatabase().getRefs()) { rw.markStart(rw.parseCommit(ref.getObjectId())); } for (RevCommit next; (next = rw.next()) != null;) { diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java index a26ae10af3..cb92a955bc 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkUtilsReachableTest.java @@ -115,7 +115,7 @@ public class RevWalkUtilsReachableTest extends RevWalkTestCase { } private void assertContains(RevCommit commit, Collection<Ref> refsThatShouldContainCommit) throws Exception { - Collection<Ref> allRefs = db.getAllRefs().values(); + Collection<Ref> allRefs = db.getRefDatabase().getRefs(); Collection<Ref> sortedRefs = RefComparator.sort(allRefs); List<Ref> actual = RevWalkUtils.findBranchesReachableFrom(commit, rw, sortedRefs); |