dat errorcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/src/odb.c b/src/odb.c
index d0b2323..a0d3063 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -608,7 +608,7 @@ int git_odb__read_header_or_object(
int git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id)
{
unsigned int i;
- int error = GIT_ENOTFOUND;
+ int error;
bool refreshed = false;
git_rawobj raw;
@@ -624,6 +624,7 @@ int git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id)
return 0;
attempt_lookup:
+ error = GIT_ENOTFOUND;
for (i = 0; i < db->backends.length && error < 0; ++i) {
backend_internal *internal = git_vector_get(&db->backends, i);
diff --git a/src/odb_pack.c b/src/odb_pack.c
index e1b44d9..9d0c4c0 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -600,7 +600,12 @@ int git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir)
}
if (git_path_isdir(git_buf_cstr(&path)) == true) {
+ int error;
+
backend->pack_folder = git_buf_detach(&path);
+ error = pack_backend__refresh((git_odb_backend *)backend);
+ if (error < 0)
+ return error;
}
backend->parent.read = &pack_backend__read;