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.junit/src | |
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.junit/src')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java | 6 |
1 files changed, 3 insertions, 3 deletions
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<R extends Repository> { 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<R extends Repository> { 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<R extends Repository> { final File pack, idx; try (PackWriter pw = new PackWriter(db)) { Set<ObjectId> 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); |