Exemplo n.º 1
0
 def read(self):
     """Read current contents of index from disk."""
     f = GitFile(self._filename, 'rb')
     try:
         f = SHA1Reader(f)
         for x in read_index(f):
             self[x[0]] = tuple(x[1:])
         # FIXME: Additional data?
         f.read(os.path.getsize(self._filename)-f.tell()-20)
         f.check_sha()
     finally:
         f.close()
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 4
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()