MCPcopy Create free account
hub / github.com/git/git / fsck_blobs

Function fsck_blobs

fsck.c:1320–1359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1318}
1319
1320static int fsck_blobs(struct oidset *blobs_found, struct oidset *blobs_done,
1321 enum fsck_msg_id msg_missing, enum fsck_msg_id msg_type,
1322 struct fsck_options *options, const char *blob_type)
1323{
1324 int ret = 0;
1325 struct oidset_iter iter;
1326 const struct object_id *oid;
1327
1328 oidset_iter_init(blobs_found, &iter);
1329 while ((oid = oidset_iter_next(&iter))) {
1330 enum object_type type;
1331 size_t size;
1332 char *buf;
1333
1334 if (oidset_contains(blobs_done, oid))
1335 continue;
1336
1337 buf = odb_read_object(options->repo->objects, oid, &type, &size);
1338 if (!buf) {
1339 if (is_promisor_object(options->repo, oid))
1340 continue;
1341 ret |= report(options,
1342 oid, OBJ_BLOB, msg_missing,
1343 "unable to read %s blob", blob_type);
1344 continue;
1345 }
1346
1347 if (type == OBJ_BLOB)
1348 ret |= fsck_blob(oid, buf, size, options);
1349 else
1350 ret |= report(options, oid, type, msg_type,
1351 "non-blob found at %s", blob_type);
1352 free(buf);
1353 }
1354
1355 oidset_clear(blobs_found);
1356 oidset_clear(blobs_done);
1357
1358 return ret;
1359}
1360
1361int fsck_finish(struct fsck_options *options)
1362{

Callers 1

fsck_finishFunction · 0.85

Calls 8

oidset_iter_initFunction · 0.85
oidset_iter_nextFunction · 0.85
oidset_containsFunction · 0.85
odb_read_objectFunction · 0.85
is_promisor_objectFunction · 0.85
fsck_blobFunction · 0.85
oidset_clearFunction · 0.85
reportFunction · 0.70

Tested by

no test coverage detected