summaryrefslogtreecommitdiff
path: root/src/odb_pack.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-03-04 01:18:30 -0500
committerEdward Thomson <ethomson@github.com>2016-03-07 10:20:01 -0500
commite10144ae57e50798e43515cb469722a4e825c23c (patch)
tree7c47bd1660b6323551c23c9e84bc360c6c33d68b /src/odb_pack.c
parent785d8c48ea8725691da3c50e7dae8751523d4c30 (diff)
downloadlibgit2-e10144ae57e50798e43515cb469722a4e825c23c.tar.gz
odb: improved not found error messages
When looking up an abbreviated oid, show the actual (abbreviated) oid the caller passed instead of a full (but ambiguously truncated) oid.
Diffstat (limited to 'src/odb_pack.c')
-rw-r--r--src/odb_pack.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 77d2c75b9..5a57864ad 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -264,7 +264,8 @@ static int pack_entry_find(struct git_pack_entry *e, struct pack_backend *backen
if (!pack_entry_find_inner(e, backend, oid, last_found))
return 0;
- return git_odb__error_notfound("failed to find pack entry", oid);
+ return git_odb__error_notfound(
+ "failed to find pack entry", oid, GIT_OID_HEXSZ);
}
static int pack_entry_find_prefix(
@@ -309,7 +310,8 @@ static int pack_entry_find_prefix(
}
if (!found)
- return git_odb__error_notfound("no matching pack entry for prefix", short_oid);
+ return git_odb__error_notfound("no matching pack entry for prefix",
+ short_oid, len);
else
return 0;
}
@@ -333,7 +335,7 @@ static int pack_backend__refresh(git_odb_backend *backend_)
return 0;
if (p_stat(backend->pack_folder, &st) < 0 || !S_ISDIR(st.st_mode))
- return git_odb__error_notfound("failed to refresh packfiles", NULL);
+ return git_odb__error_notfound("failed to refresh packfiles", NULL, 0);
git_buf_sets(&path, backend->pack_folder);