From: Han-Wen Nienhuys Date: Thu, 9 Aug 2018 14:30:09 +0000 (+0200) Subject: Use a TreeMap to construct the list of renamed projects X-Git-Tag: v5.1.0.201808281540-m3~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d1dc49e968d75193f3f6d8c14412afa75631825b;p=jgit.git Use a TreeMap to construct the list of renamed projects This eliminates one source of unpredictable ordering of entries in .gitmodules. Signed-off-by: Han-Wen Nienhuys Change-Id: I834ae57bd18f51966ef76c039f5212ebf60a33e8 --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java index 2046ba7b43..45a239da0e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java @@ -52,11 +52,11 @@ import java.io.InputStream; import java.net.URI; import java.text.MessageFormat; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.StringJoiner; +import java.util.TreeMap; import org.eclipse.jgit.annotations.Nullable; import org.eclipse.jgit.api.Git; @@ -736,7 +736,7 @@ public class RepoCommand extends GitCommand { * @return projects that are renamed if necessary */ private List renameProjects(List projects) { - Map> m = new HashMap<>(); + Map> m = new TreeMap<>(); for (RepoProject proj : projects) { List l = m.get(proj.getName()); if (l == null) {