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

Function close_one_pack

packfile.c:535–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533}
534
535static int close_one_pack(struct repository *r)
536{
537 struct odb_source *source;
538 struct packfile_list_entry *e;
539 struct packed_git *lru_p = NULL;
540 struct pack_window *mru_w = NULL;
541 int accept_windows_inuse = 1;
542
543 for (source = r->objects->sources; source; source = source->next) {
544 struct odb_source_files *files = odb_source_files_downcast(source);
545 for (e = files->packed->packs.head; e; e = e->next) {
546 if (e->pack->pack_fd == -1)
547 continue;
548 find_lru_pack(e->pack, &lru_p, &mru_w, &accept_windows_inuse);
549 }
550 }
551
552 if (lru_p)
553 return close_pack_fd(lru_p);
554
555 return 0;
556}
557
558static unsigned int get_max_fd_limit(void)
559{

Callers 1

open_packed_git_1Function · 0.85

Calls 3

find_lru_packFunction · 0.85
close_pack_fdFunction · 0.85

Tested by

no test coverage detected