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

Function write_shallow_commits_1

shallow.c:388–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388static int write_shallow_commits_1(struct strbuf *out, int use_pack_protocol,
389 const struct oid_array *extra,
390 unsigned flags)
391{
392 struct write_shallow_data data = {
393 .out = out,
394 .use_pack_protocol = use_pack_protocol,
395 .flags = flags,
396 };
397
398 for_each_commit_graft(write_one_shallow, &data);
399 if (!extra)
400 return data.count;
401 for (size_t i = 0; i < extra->nr; i++) {
402 strbuf_add_oid_hex(out, extra->oid + i);
403 strbuf_addch(out, '\n');
404 data.count++;
405 }
406 return data.count;
407}
408
409int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
410 const struct oid_array *extra)

Callers 2

write_shallow_commitsFunction · 0.85
prune_shallowFunction · 0.85

Calls 3

for_each_commit_graftFunction · 0.85
strbuf_add_oid_hexFunction · 0.85
strbuf_addchFunction · 0.85

Tested by

no test coverage detected