public void testTreeIteratorWithGitmodules() throws Exception {
final ObjectId subId = ObjectId
.fromString("abcd1234abcd1234abcd1234abcd1234abcd1234");
final String path = "sub";
final Config gitmodules = new Config();
gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_PATH,
"sub");
gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_URL,
"git://example.com/sub");
RevCommit commit = testDb.getRevWalk().parseCommit(testDb.commit()
.noParents()
.add(DOT_GIT_MODULES, gitmodules.toText())
.edit(new PathEdit(path) {
public void apply(DirCacheEntry ent) {
ent.setFileMode(FileMode.GITLINK);
ent.setObjectId(subId);