From d1dc49e968d75193f3f6d8c14412afa75631825b Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 9 Aug 2018 16:30:09 +0200 Subject: [PATCH] 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 --- .../src/org/eclipse/jgit/gitrepo/RepoCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.39.5