Merge pull request #4264 from libgit2/ethomson/read_prefix

odb_read_prefix: reset error in backends loop
diff --git a/src/odb.c b/src/odb.c
index b66324f..ae8f247 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -1116,8 +1116,11 @@
 		if (b->read_prefix != NULL) {
 			git_oid full_oid;
 			error = b->read_prefix(&full_oid, &raw.data, &raw.len, &raw.type, b, key, len);
-			if (error == GIT_ENOTFOUND || error == GIT_PASSTHROUGH)
+
+			if (error == GIT_ENOTFOUND || error == GIT_PASSTHROUGH) {
+				error = 0;
 				continue;
+			}
 
 			if (error)
 				goto out;