private static ITypedElement getIndexTypedElement(
final Repository repository, final String gitPath, String encoding) {
IFileRevision nextFile = GitFileRevision.inIndex(repository, gitPath);
final EditableRevision next = new EditableRevision(nextFile, encoding);
IContentChangeListener listener = new IContentChangeListener() {
public void contentChanged(IContentChangeNotifier source) {
final byte[] newContent = next.getModifiedContent();
setIndexEntryContents(repository, gitPath, newContent);
}
};