'Read current contents of index from disk.'

def read(self):

    if (not os.path.exists(self._filename)):
        return
    f = GitFile(self._filename, 'rb')
    try:
        f = SHA1Reader(f)
        for x in read_index(f):
            self[x[0]] = IndexEntry(*x[1:])
        f.read(((os.path.getsize(self._filename) - f.tell()) - 20))
        f.check_sha()
    finally:
        f.close()
