summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2023-11-08 18:15:51 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2023-11-08 18:15:51 -0500
commitc2c61a88f9b1740733b847402f8f3b6a8ba0ddca (patch)
tree269798c23e8d91cbc7571ac9761fbccb4524a9b7 /org.eclipse.jgit
parent66cf4f6f241f81f359fbd1d9f87ffc3e3946dbe3 (diff)
parent7ac2d257362120d8813c1ddc069afb873afe0540 (diff)
downloadjgit-c2c61a88f9b1740733b847402f8f3b6a8ba0ddca.tar.gz
jgit-c2c61a88f9b1740733b847402f8f3b6a8ba0ddca.zip
Merge "Revert "Optimise Git protocol v2 `ref-prefix` scanning""
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
index f3726868cb..9e05a39731 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
@@ -474,9 +474,11 @@ public abstract class RefDatabase {
*/
@NonNull
public List<Ref> getRefsByPrefix(String... prefixes) throws IOException {
- return getRefsByPrefix(ALL).parallelStream().filter(
- ref -> Stream.of(prefixes).anyMatch(ref.getName()::startsWith))
- .collect(Collectors.toUnmodifiableList());
+ List<Ref> result = new ArrayList<>();
+ for (String prefix : prefixes) {
+ result.addAll(getRefsByPrefix(prefix));
+ }
+ return Collections.unmodifiableList(result);
}