]> source.dussan.org Git - jgit.git/commitdiff
Use a TreeMap to construct the list of renamed projects 50/127250/4
authorHan-Wen Nienhuys <hanwen@google.com>
Thu, 9 Aug 2018 14:30:09 +0000 (16:30 +0200)
committerJonathan Nieder <jrn@google.com>
Mon, 13 Aug 2018 16:17:58 +0000 (12:17 -0400)
This eliminates one source of unpredictable ordering of entries in .gitmodules.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I834ae57bd18f51966ef76c039f5212ebf60a33e8

org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

index 2046ba7b43e12b78759a2f28003305f4c2c76bb3..45a239da0e1212608911db6b5a4882233b0d5387 100644 (file)
@@ -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<RevCommit> {
         * @return projects that are renamed if necessary
         */
        private List<RepoProject> renameProjects(List<RepoProject> projects) {
-               Map<String, List<RepoProject>> m = new HashMap<>();
+               Map<String, List<RepoProject>> m = new TreeMap<>();
                for (RepoProject proj : projects) {
                        List<RepoProject> l = m.get(proj.getName());
                        if (l == null) {