MCPcopy Create free account
hub / github.com/ReZeroS/git / compareTrees

Method compareTrees

src/main/java/club/qqtim/diff/DiffUtil.java:119–131  ·  view source on GitHub ↗

given trees, return path, object ids @param trees compare trees @return key path, val objectIds

(Map<String, String>... trees)

Source from the content-addressed store, hash-verified

117 * @return key path, val objectIds
118 */
119 @SafeVarargs
120 public static Map<String, List<String>> compareTrees(Map<String, String>... trees) {
121 Map<String, List<String>> entries = new HashMap<>(1);
122 for (int i = 0; i < trees.length; i++) {
123 for (Map.Entry<String, String> entry : trees[i].entrySet()) {
124 String path = entry.getKey();
125 String objectId = entry.getValue();
126 entries.putIfAbsent(path, new ArrayList<>(Collections.nCopies(trees.length, null)));
127 entries.get(path).set(i, objectId);
128 }
129 }
130 return entries;
131 }
132
133 /**
134 * key: path val: blob content

Callers 3

iteratorChangedFilesMethod · 0.95
diffTreesMethod · 0.95
mergeTreesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected