summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorJameson Miller <jamill@microsoft.com>2012-09-26 17:21:32 -0400
committerJameson Miller <jamill@microsoft.com>2012-09-27 13:12:27 -0400
commitaddc9be4fcb88e77107557e991bd92355522d844 (patch)
tree60f4bf02508f6f331d0d72c90cf1b0fcbf8cc162 /src/odb.c
parent5942bd18bf557cc70873009c4303a421c83f0129 (diff)
downloadlibgit2-addc9be4fcb88e77107557e991bd92355522d844.tar.gz
Fix error hashing empty file.
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/odb.c b/src/odb.c
index d1ffff652..d951bc51b 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -115,7 +115,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
int hdr_len;
char hdr[64], buffer[2048];
git_hash_ctx *ctx;
- ssize_t read_len = -1;
+ ssize_t read_len = 0;
if (!git_object_typeisloose(type)) {
giterr_set(GITERR_INVALID, "Invalid object type for hash");