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

Function write_bundle_prerequisites

bundle.c:451–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449};
450
451static void write_bundle_prerequisites(struct commit *commit, void *data)
452{
453 struct bundle_prerequisites_info *bpi = data;
454 struct object *object;
455 struct pretty_print_context ctx = { 0 };
456 struct strbuf buf = STRBUF_INIT;
457
458 if (!(commit->object.flags & BOUNDARY))
459 return;
460 strbuf_addf(&buf, "-%s ", oid_to_hex(&commit->object.oid));
461 write_or_die(bpi->fd, buf.buf, buf.len);
462
463 ctx.fmt = CMIT_FMT_ONELINE;
464 ctx.output_encoding = get_log_output_encoding();
465 strbuf_reset(&buf);
466 pretty_print_commit(&ctx, commit, &buf);
467 strbuf_trim(&buf);
468
469 object = (struct object *)commit;
470 object->flags |= UNINTERESTING;
471 add_object_array_with_path(object, buf.buf, bpi->pending, S_IFINVALID,
472 NULL);
473 strbuf_addch(&buf, '\n');
474 write_or_die(bpi->fd, buf.buf, buf.len);
475 strbuf_release(&buf);
476}
477
478int create_bundle(struct repository *r, const char *path,
479 int argc, const char **argv, struct strvec *pack_options, int version)

Callers

nothing calls this directly

Calls 9

strbuf_addfFunction · 0.85
oid_to_hexFunction · 0.85
write_or_dieFunction · 0.85
get_log_output_encodingFunction · 0.85
pretty_print_commitFunction · 0.85
strbuf_trimFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected