From 7b78caf7420af0c9016691de2d8a49efd0574962 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 15 Jan 2019 14:31:58 +0900 Subject: [PATCH] AbstractDaemonTest: Use exactRef instead of getRefs Change-Id: I4468985c6cce39c31da8bf4ae043f9cc18f056d1 --- .../google/gerrit/acceptance/AbstractDaemonTest.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java index 0e62938862..3c8f170399 100644 --- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java +++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java @@ -14,7 +14,6 @@ package com.google.gerrit.acceptance; -import static com.google.common.collect.ImmutableMap.toImmutableMap; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assert_; import static com.google.common.truth.Truth8.assertThat; @@ -1209,13 +1208,6 @@ public abstract class AbstractDaemonTest { throws Exception { TestRepository localRepo = cloneProject(proj); GitUtil.fetch(localRepo, "refs/*:refs/*"); - ImmutableMap refs = - localRepo - .getRepository() - .getRefDatabase() - .getRefs() - .stream() - .collect(toImmutableMap(Ref::getName, r -> r)); Map refValues = new HashMap<>(); for (Branch.NameKey b : trees.keySet()) { @@ -1223,7 +1215,7 @@ public abstract class AbstractDaemonTest { continue; } - Ref r = refs.get(b.get()); + Ref r = localRepo.getRepository().exactRef(b.get()); assertThat(r).isNotNull(); RevWalk rw = localRepo.getRevWalk(); RevCommit c = rw.parseCommit(r.getObjectId());