diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-05-15 09:56:32 +0900 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2018-05-15 18:02:39 -0400 |
commit | 46b7128a2e604c85d9c8ce0ce5501a994105a49c (patch) | |
tree | 7571fade80c1b0ca6f9de632535e33b3abfc78ee /org.eclipse.jgit | |
parent | 6d370d837c5faa7caff2e6e3e4723b887f2fbdca (diff) | |
download | jgit-46b7128a2e604c85d9c8ce0ce5501a994105a49c.tar.gz jgit-46b7128a2e604c85d9c8ce0ce5501a994105a49c.zip |
BatchRefUpdate: Don't use deprecated RefDatabase#getRefs(String)
Change-Id: I672c9cfe221ddc4acbde7a8040bd6ba83b16626e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java index 5e17553706..925b6beadb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java @@ -46,6 +46,7 @@ package org.eclipse.jgit.lib; import static org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED; import static org.eclipse.jgit.transport.ReceiveCommand.Result.REJECTED_OTHER_REASON; +import static java.util.stream.Collectors.toCollection; import java.io.IOException; import java.text.MessageFormat; @@ -528,8 +529,9 @@ public class BatchRefUpdate { } if (!commands2.isEmpty()) { // What part of the name space is already taken - Collection<String> takenNames = new HashSet<>(refdb.getRefs( - RefDatabase.ALL).keySet()); + Collection<String> takenNames = refdb.getRefs().stream() + .map(Ref::getName) + .collect(toCollection(HashSet::new)); Collection<String> takenPrefixes = getTakenPrefixes(takenNames); // Now to the update that may require more room in the name space |