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

Function get_info_packs

http-backend.c:610–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608}
609
610static void get_info_packs(struct strbuf *hdr, char *arg UNUSED)
611{
612 size_t objdirlen = strlen(repo_get_object_directory(the_repository));
613 struct strbuf buf = STRBUF_INIT;
614 struct packed_git *p;
615 size_t cnt = 0;
616
617 select_getanyfile(hdr);
618 repo_for_each_pack(the_repository, p) {
619 if (p->pack_local)
620 cnt++;
621 }
622
623 strbuf_grow(&buf, cnt * 53 + 2);
624 repo_for_each_pack(the_repository, p) {
625 if (p->pack_local)
626 strbuf_addf(&buf, "P %s\n", p->pack_name + objdirlen + 6);
627 }
628 strbuf_addch(&buf, '\n');
629
630 hdr_nocache(hdr);
631 send_strbuf(hdr, "text/plain; charset=utf-8", &buf);
632 strbuf_release(&buf);
633}
634
635static void check_content_type(struct strbuf *hdr, const char *accepted_type)
636{

Callers

nothing calls this directly

Calls 8

select_getanyfileFunction · 0.85
strbuf_growFunction · 0.85
strbuf_addfFunction · 0.85
strbuf_addchFunction · 0.85
hdr_nocacheFunction · 0.85
send_strbufFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected