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

Function show_object

builtin/rev-list.c:379–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379static void show_object(struct object *obj, const char *name, void *cb_data)
380{
381 struct rev_list_info *info = cb_data;
382 struct rev_info *revs = info->revs;
383
384 if (finish_object(obj, name, cb_data))
385 return;
386 display_progress(progress, ++progress_counter);
387 if (show_disk_usage)
388 total_disk_usage += get_object_disk_usage(obj);
389 if (info->flags & REV_LIST_QUIET)
390 return;
391
392 if (revs->count) {
393 /*
394 * The object count is always accumulated in the .count_right
395 * field for traversal that is not a left-right traversal,
396 * and cmd_rev_list() made sure that a .count request that
397 * wants to count non-commit objects, which is handled by
398 * the show_object() callback, does not ask for .left_right.
399 */
400 revs->count_right++;
401 return;
402 }
403
404 printf("%s", oid_to_hex(&obj->oid));
405
406 if (arg_show_object_names) {
407 if (line_term) {
408 putchar(info_term);
409 for (const char *p = name; *p && *p != '\n'; p++)
410 putchar(*p);
411 } else if (*name) {
412 printf("%cpath=%s", info_term, name);
413 }
414 }
415
416 putchar(line_term);
417}
418
419static void show_edge(struct commit *commit)
420{

Callers

nothing calls this directly

Calls 4

finish_objectFunction · 0.85
display_progressFunction · 0.85
get_object_disk_usageFunction · 0.85
oid_to_hexFunction · 0.85

Tested by

no test coverage detected