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

Function worker_loop

builtin/checkout--worker.c:85–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static void worker_loop(struct checkout *state)
86{
87 struct parallel_checkout_item *items = NULL;
88 size_t i, nr = 0, alloc = 0;
89
90 while (1) {
91 int len = packet_read(0, packet_buffer, sizeof(packet_buffer),
92 0);
93
94 if (len < 0)
95 BUG("packet_read() returned negative value");
96 else if (!len)
97 break;
98
99 ALLOC_GROW(items, nr + 1, alloc);
100 packet_to_pc_item(packet_buffer, len, &items[nr++]);
101 }
102
103 for (i = 0; i < nr; i++) {
104 struct parallel_checkout_item *pc_item = &items[i];
105 write_pc_item(pc_item, state);
106 report_result(pc_item);
107 release_pc_item_data(pc_item);
108 }
109
110 packet_flush(1);
111
112 free(items);
113}
114
115static const char * const checkout_worker_usage[] = {
116 N_("git checkout--worker [<options>]"),

Callers 1

cmd_checkout__workerFunction · 0.85

Calls 6

packet_readFunction · 0.85
packet_to_pc_itemFunction · 0.85
write_pc_itemFunction · 0.85
report_resultFunction · 0.85
release_pc_item_dataFunction · 0.85
packet_flushFunction · 0.85

Tested by

no test coverage detected