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

Function fsck_options_init

fsck.c:1381–1427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1379}
1380
1381void fsck_options_init(struct fsck_options *options,
1382 struct repository *repo,
1383 enum fsck_options_type type)
1384{
1385 static const struct fsck_options defaults[] = {
1386 [FSCK_OPTIONS_DEFAULT] = {
1387 .skip_oids = OIDSET_INIT,
1388 .gitmodules_found = OIDSET_INIT,
1389 .gitmodules_done = OIDSET_INIT,
1390 .gitattributes_found = OIDSET_INIT,
1391 .gitattributes_done = OIDSET_INIT,
1392 .error_func = fsck_objects_error_function
1393 },
1394 [FSCK_OPTIONS_STRICT] = {
1395 .strict = 1,
1396 .gitmodules_found = OIDSET_INIT,
1397 .gitmodules_done = OIDSET_INIT,
1398 .gitattributes_found = OIDSET_INIT,
1399 .gitattributes_done = OIDSET_INIT,
1400 .error_func = fsck_objects_error_function,
1401 },
1402 [FSCK_OPTIONS_MISSING_GITMODULES] = {
1403 .strict = 1,
1404 .gitmodules_found = OIDSET_INIT,
1405 .gitmodules_done = OIDSET_INIT,
1406 .gitattributes_found = OIDSET_INIT,
1407 .gitattributes_done = OIDSET_INIT,
1408 .error_func = fsck_objects_error_cb_print_missing_gitmodules,
1409 },
1410 [FSCK_OPTIONS_REFS] = {
1411 .error_func = fsck_refs_error_function,
1412 },
1413 };
1414
1415 switch (type) {
1416 case FSCK_OPTIONS_DEFAULT:
1417 case FSCK_OPTIONS_STRICT:
1418 case FSCK_OPTIONS_MISSING_GITMODULES:
1419 case FSCK_OPTIONS_REFS:
1420 memcpy(options, &defaults[type], sizeof(*options));
1421 break;
1422 default:
1423 BUG("unknown fsck options type %d", type);
1424 }
1425
1426 options->repo = repo;
1427}
1428
1429void fsck_options_clear(struct fsck_options *options)
1430{

Callers 9

do_fetch_packFunction · 0.85
do_fetch_pack_v2Function · 0.85
index_memFunction · 0.85
cmd_index_packFunction · 0.85
cmd_mktagFunction · 0.85
cmd_fsckFunction · 0.85
cmd_refs_verifyFunction · 0.85
cmd_unpack_objectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected