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

Function print_commit

builtin/log.c:2593–2607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2591};
2592
2593static void print_commit(char sign, struct commit *commit, int verbose,
2594 int abbrev, FILE *file)
2595{
2596 if (!verbose) {
2597 fprintf(file, "%c %s\n", sign,
2598 repo_find_unique_abbrev(the_repository, &commit->object.oid, abbrev));
2599 } else {
2600 struct strbuf buf = STRBUF_INIT;
2601 pp_commit_easy(CMIT_FMT_ONELINE, commit, &buf);
2602 fprintf(file, "%c %s %s\n", sign,
2603 repo_find_unique_abbrev(the_repository, &commit->object.oid, abbrev),
2604 buf.buf);
2605 strbuf_release(&buf);
2606 }
2607}
2608
2609/*
2610 * Enumerate blob OIDs from a single commit's diff, inserting them into blobs.

Callers 1

cmd_cherryFunction · 0.70

Calls 3

repo_find_unique_abbrevFunction · 0.85
pp_commit_easyFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected