public void indexWithGitmodules() 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");
// Different config in the index should be overridden by the working tree.
gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_URL,
"git://example.com/bad");
final RevBlob gitmodulesBlob = testDb.blob(gitmodules.toText());
gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_URL,
"git://example.com/sub");
writeTrashFile(DOT_GIT_MODULES, gitmodules.toText());
DirCache cache = db.lockDirCache();
DirCacheEditor editor = cache.editor();
editor.add(new PathEdit(path) {