MCPcopy Index your code
hub / github.com/git/git / repo_get_commit_buffer

Function repo_get_commit_buffer

commit.c:391–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391const void *repo_get_commit_buffer(struct repository *r,
392 const struct commit *commit,
393 unsigned long *sizep)
394{
395 const void *ret = get_cached_commit_buffer(r, commit, sizep);
396 if (!ret) {
397 enum object_type type;
398 size_t size;
399 ret = odb_read_object(r->objects, &commit->object.oid, &type, &size);
400 if (!ret)
401 die("cannot read commit object %s",
402 oid_to_hex(&commit->object.oid));
403 if (type != OBJ_COMMIT)
404 die("expected commit for %s, got %s",
405 oid_to_hex(&commit->object.oid), type_name(type));
406 if (sizep)
407 *sizep = cast_size_t_to_ulong(size);
408 }
409 return ret;
410}
411
412void repo_unuse_commit_buffer(struct repository *r,
413 const struct commit *commit,

Callers 14

record_personFunction · 0.85
repo_logmsg_reencodeFunction · 0.85
get_oid_onelineFunction · 0.85
notes_merge_commitFunction · 0.85
record_author_dateFunction · 0.85
parse_signed_commitFunction · 0.85
check_commit_signatureFunction · 0.85
handle_commitFunction · 0.85
make_cover_letterFunction · 0.85
do_import_stashFunction · 0.85

Calls 6

get_cached_commit_bufferFunction · 0.85
odb_read_objectFunction · 0.85
oid_to_hexFunction · 0.85
type_nameFunction · 0.85
cast_size_t_to_ulongFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected