Commit 138e4c2bd07690e8956c4733b90b024c65a2ef88

Edward Thomson 2018-02-01T06:35:31

git_odb__hashfd: propagate error on failures

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/odb.c b/src/odb.c
index 47fdd13..82b4310 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -194,7 +194,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
 	}
 
 	if ((error = git_hash_ctx_init(&ctx)) < 0)
-		return -1;
+		return error;
 
 	hdr_len = git_odb__format_object_header(hdr, sizeof(hdr), size, type);