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

Function git_config_from_blob_oid

config.c:1456–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454}
1455
1456int git_config_from_blob_oid(config_fn_t fn,
1457 const char *name,
1458 struct repository *repo,
1459 const struct object_id *oid,
1460 void *data,
1461 enum config_scope scope)
1462{
1463 enum object_type type;
1464 char *buf;
1465 size_t size;
1466 int ret;
1467
1468 buf = odb_read_object(repo->objects, oid, &type, &size);
1469 if (!buf)
1470 return error(_("unable to load config blob object '%s'"), name);
1471 if (type != OBJ_BLOB) {
1472 free(buf);
1473 return error(_("reference '%s' does not point to a blob"), name);
1474 }
1475
1476 ret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size,
1477 data, scope, NULL);
1478 free(buf);
1479
1480 return ret;
1481}
1482
1483static int git_config_from_blob_ref(config_fn_t fn,
1484 struct repository *repo,

Callers 2

git_config_from_blob_refFunction · 0.85
gitmodules_config_oidFunction · 0.85

Calls 3

odb_read_objectFunction · 0.85
errorFunction · 0.85
git_config_from_memFunction · 0.85

Tested by

no test coverage detected