def read(self):
     """Read current contents of index from disk."""
     f = open(self._filename, 'rb')
     try:
         f = SHA1Reader(f)
         for x in read_index(f):
             self[x[0]] = tuple(x[1:])
         f.check_sha()
     finally:
         f.close()
Beispiel #2
0
 def read(self):
     """Read current contents of index from disk."""
     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:])
         # FIXME: Additional data?
         f.read(os.path.getsize(self._filename)-f.tell()-20)
         f.check_sha()
     finally:
         f.close()
Beispiel #3
0
 def read(self):
     """Read current contents of index from disk."""
     if not os.path.exists(self._filename):
         return
     f = GitFile(self._filename, "rb")
     try:
         f = SHA1Reader(f)
         for name, entry in read_index(f):
             self[name] = entry
         # FIXME: Additional data?
         f.read(os.path.getsize(self._filename) - f.tell() - 20)
         f.check_sha()
     finally:
         f.close()