From 1f6d43a6528212f270f0f4542ee0cb54cd1a2435 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 23 May 2018 13:31:22 +0900 Subject: 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 --- .../src/org/eclipse/jgit/junit/TestRepository.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'org.eclipse.jgit.junit/src') 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 d23c0d3c22..29a4100193 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 @@ -757,7 +757,7 @@ public class TestRepository { public void updateServerInfo() throws Exception { if (db instanceof FileRepository) { final FileRepository fr = (FileRepository) db; - RefWriter rw = new RefWriter(fr.getAllRefs().values()) { + RefWriter rw = new RefWriter(fr.getRefDatabase().getRefs()) { @Override protected void writeFile(String name, byte[] bin) throws IOException { @@ -852,7 +852,7 @@ public class TestRepository { for (RevObject o : tips) ow.markStart(ow.parseAny(o)); } else { - for (Ref r : db.getAllRefs().values()) + for (Ref r : db.getRefDatabase().getRefs()) ow.markStart(ow.parseAny(r.getObjectId())); } @@ -905,7 +905,7 @@ public class TestRepository { final File pack, idx; try (PackWriter pw = new PackWriter(db)) { Set all = new HashSet<>(); - for (Ref r : db.getAllRefs().values()) + for (Ref r : db.getRefDatabase().getRefs()) all.add(r.getObjectId()); pw.preparePack(m, all, PackWriter.NONE); -- cgit v1.2.3