Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-17 04:12:04 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-17 04:12:04 +0400
commit090a07d29548ce69034b4be6ba043014226893c9 (patch)
treea4bf02679ffd088bcbf69d8756149eb88a14575d /src/odb.c
parent7a3764bee92456e5ee2ed41be9abb0ffb4165eb7 (diff)
odb: avoid hashing twice in and edge case
If none of the backends support direct writes and we must stream the whole file, we already know what the object's id should be; so use the stream's functions directly, bypassing the frontend's hashing and overwriting of our existing id.
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/odb.c b/src/odb.c
index d2be60f97..21b46bf56 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -864,8 +864,8 @@ int git_odb_write(
if ((error = git_odb_open_wstream(&stream, db, len, type)) != 0)
return error;
- git_odb_stream_write(stream, data, len);
- error = git_odb_stream_finalize_write(oid, stream);
+ stream->write(stream, data, len);
+ error = stream->finalize_write(stream, oid);
git_odb_stream_free(stream);
return error;