summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/odb.c b/src/odb.c
index e47715f79..dfb252178 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -900,6 +900,10 @@ int git_odb_stream_write(git_odb_stream *stream, const char *buffer, size_t len)
int git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stream)
{
git_hash_final(out, stream->hash_ctx);
+
+ if (git_odb_exists(stream->backend->odb, out))
+ return 0;
+
return stream->finalize_write(stream, out);
}