"git://example.com/sub");
writeTrashFile(DOT_GIT_MODULES, gitmodules.toText());
DirCache cache = db.lockDirCache();
DirCacheEditor editor = cache.editor();
editor.add(new PathEdit(path) {
public void apply(DirCacheEntry ent) {
ent.setFileMode(FileMode.GITLINK);
ent.setObjectId(subId);
}
});
editor.add(new PathEdit(DOT_GIT_MODULES) {
public void apply(DirCacheEntry ent) {
ent.setFileMode(FileMode.REGULAR_FILE);
ent.setObjectId(gitmodulesBlob);
}