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

Method checkoutIndex

src/main/java/club/qqtim/command/ReadTree.java:108–120  ·  view source on GitHub ↗

index must only have one layer

(Map<String, String> index)

Source from the content-addressed store, hash-verified

106 * index must only have one layer
107 */
108 public static void checkoutIndex(Map<String, String> index) {
109 // clean current dir
110 emptyCurrentDir();
111
112 for (Map.Entry<String, String> pathObjectId : index.entrySet()) {
113 String path = pathObjectId.getKey();
114 String objectId = pathObjectId.getValue();
115 FileUtil.createParentDirs(path);
116 final byte[] objectBytes = ZitContext.getObject(objectId);
117 FileUtil.createFile(objectBytes, path);
118 }
119
120 }
121
122
123}

Callers 2

readTreeMethod · 0.95
readTreeMergedMethod · 0.95

Calls 4

createParentDirsMethod · 0.95
getObjectMethod · 0.95
createFileMethod · 0.95
emptyCurrentDirMethod · 0.80

Tested by

no test coverage detected