summaryrefslogtreecommitdiff
path: root/include/git2/odb_backend.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-15 14:29:39 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-15 14:29:39 +0200
commit8380b39a6761efa360398279083a65064d6770d3 (patch)
treeda94a1a19030319d68e211478b9fe75a0f4cc06e /include/git2/odb_backend.h
parent376e6c9f96ffcd572ba974c9cc4d13b4f1e31474 (diff)
downloadlibgit2-8380b39a6761efa360398279083a65064d6770d3.tar.gz
odb: perform the stream hashing in the frontend
Hash the data as it's coming into the stream and tell the backend what its name is when finalizing the write. This makes it consistent with the way a plain git_odb_write() performs the write.
Diffstat (limited to 'include/git2/odb_backend.h')
-rw-r--r--include/git2/odb_backend.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h
index af1e3e5b9..d004238a4 100644
--- a/include/git2/odb_backend.h
+++ b/include/git2/odb_backend.h
@@ -65,10 +65,13 @@ typedef enum {
GIT_STREAM_RW = (GIT_STREAM_RDONLY | GIT_STREAM_WRONLY),
} git_odb_stream_t;
+typedef struct git_hash_ctx git_hash_ctx;
+
/** A stream to read/write from a backend */
struct git_odb_stream {
git_odb_backend *backend;
unsigned int mode;
+ git_hash_ctx *hash_ctx;
int (*read)(git_odb_stream *stream, char *buffer, size_t len);
int (*write)(git_odb_stream *stream, const char *buffer, size_t len);