summaryrefslogtreecommitdiff
path: root/src/odb_loose.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-05-04 16:46:46 -0700
committerRussell Belfer <rb@github.com>2012-05-04 16:46:46 -0700
commit282283acc65bab9de231a2b3dc489eb171d5f1cf (patch)
tree402e4a5699e5d2182b542e0eb2468f564951094f /src/odb_loose.c
parent3ec1fa5e1c0ee0e151a44267fa6496ecdf604eb9 (diff)
downloadlibgit2-282283acc65bab9de231a2b3dc489eb171d5f1cf.tar.gz
Fix valgrind issues
There are three changes here: - correctly propogate error code from failed object lookups - make zlib inflate use our allocators - add OID to notfound error in ODB lookups
Diffstat (limited to 'src/odb_loose.c')
-rw-r--r--src/odb_loose.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c
index d028deca5..989b03ab2 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -528,7 +528,7 @@ static int locate_object_short_oid(
/* Check that directory exists */
if (git_path_isdir(object_location->ptr) == false)
- return git_odb__error_notfound("failed to locate from short oid");
+ return git_odb__error_notfound("no matching loose object for prefix", short_oid);
state.dir_len = git_buf_len(object_location);
state.short_oid_len = len;
@@ -541,7 +541,7 @@ static int locate_object_short_oid(
return error;
if (!state.found)
- return git_odb__error_notfound("failed to locate from short oid");
+ return git_odb__error_notfound("no matching loose object for prefix", short_oid);
/* Convert obtained hex formatted oid to raw */
error = git_oid_fromstr(res_oid, (char *)state.res_oid);
@@ -590,7 +590,7 @@ static int loose_backend__read_header(size_t *len_p, git_otype *type_p, git_odb_
raw.type = GIT_OBJ_BAD;
if (locate_object(&object_path, (loose_backend *)backend, oid) < 0)
- error = git_odb__error_notfound("in loose backend");
+ error = git_odb__error_notfound("no matching loose object", oid);
else if ((error = read_header_loose(&raw, &object_path)) == 0) {
*len_p = raw.len;
*type_p = raw.type;
@@ -610,7 +610,7 @@ static int loose_backend__read(void **buffer_p, size_t *len_p, git_otype *type_p
assert(backend && oid);
if (locate_object(&object_path, (loose_backend *)backend, oid) < 0)
- error = git_odb__error_notfound("in loose backend");
+ error = git_odb__error_notfound("no matching loose object", oid);
else if ((error = read_loose(&raw, &object_path)) == 0) {
*buffer_p = raw.data;
*len_p = raw.len;