summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2022-03-15 22:48:48 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2022-03-19 21:41:55 +0100
commit0ae37d4000e7aa67cfdbbf2fdcaf6f0d4ef37b16 (patch)
tree63efaeb5aaddc1a43a0a009425b1e3461862868e /org.eclipse.jgit
parent7b1c8cf147b5ecd8f77bf6d3d64c40acd643af83 (diff)
downloadjgit-0ae37d4000e7aa67cfdbbf2fdcaf6f0d4ef37b16.tar.gz
jgit-0ae37d4000e7aa67cfdbbf2fdcaf6f0d4ef37b16.zip
DirCacheCheckout: use a LinkedHashMap instead of HashMap
This guarantees that updates are checked out in git order, which is important for LFS if a .lfsconfig file is used. That file comes early in git order, and the LFS smudge filter will consider the working tree version. To ensure that on branch switches the correct version of that file is used, the checkout order must be stable and should be the git order. Change-Id: I20f6d11bf08558f9d5adfd2be71e36321460038c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index 3d50a82155..f6fc393c45 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -26,9 +26,9 @@ import java.nio.file.StandardCopyOption;
import java.text.MessageFormat;
import java.time.Instant;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -113,7 +113,7 @@ public class DirCacheCheckout {
private Repository repo;
- private HashMap<String, CheckoutMetadata> updated = new HashMap<>();
+ private Map<String, CheckoutMetadata> updated = new LinkedHashMap<>();
private ArrayList<String> conflicts = new ArrayList<>();