summaryrefslogtreecommitdiff
path: root/lib/git/utils.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-02 22:40:52 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-02 22:40:52 +0200
commit8b86f9b399a8f5af792a04025fdeefc02883f3e5 (patch)
treef10c0bc2e8a95676e1062d2b86676eb0a5294ce1 /lib/git/utils.py
parent282018b79cc8df078381097cb3aeb29ff56e83c6 (diff)
downloadgitpython-8b86f9b399a8f5af792a04025fdeefc02883f3e5.tar.gz
initial version of loose object writing and simple cached object lookup appears to be working
Diffstat (limited to 'lib/git/utils.py')
-rw-r--r--lib/git/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/git/utils.py b/lib/git/utils.py
index c21528b1..360c77c9 100644
--- a/lib/git/utils.py
+++ b/lib/git/utils.py
@@ -61,12 +61,14 @@ def join_path_native(a, *p):
return to_native_path(join_path(a, *p))
-class SHA1Writer(object):
+class IndexFileSHA1Writer(object):
"""
Wrapper around a file-like object that remembers the SHA1 of
the data written to it. It will write a sha when the stream is closed
or if the asked for explicitly usign write_sha.
+ Only useful to the indexfile
+
Note:
Based on the dulwich project
"""
@@ -78,7 +80,7 @@ class SHA1Writer(object):
def write(self, data):
self.sha1.update(data)
- self.f.write(data)
+ return self.f.write(data)
def write_sha(self):
sha = self.sha1.digest()