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

Function parallel_next

t/helper/test-run-command.c:23–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22static int number_callbacks;
23static int parallel_next(struct child_process *cp,
24 struct strbuf *err,
25 void *cb,
26 void **task_cb)
27{
28 struct child_process *d = cb;
29 if (number_callbacks >= 4)
30 return 0;
31
32 strvec_pushv(&cp->args, d->args.v);
33 cp->in = d->in;
34 cp->no_stdin = d->no_stdin;
35 if (err)
36 strbuf_addstr(err, "preloaded output of a child\n");
37 else
38 fprintf(stderr, "preloaded output of a child\n");
39
40 number_callbacks++;
41
42 /* test_stdin callback will use this to count remaining lines */
43 *task_cb = xmalloc(sizeof(int));
44 *(int*)(*task_cb) = 2;
45
46 return 1;
47}
48
49static int no_job(struct child_process *cp UNUSED,
50 struct strbuf *err,

Callers

nothing calls this directly

Calls 3

strvec_pushvFunction · 0.85
strbuf_addstrFunction · 0.85
xmallocFunction · 0.50

Tested by

no test coverage detected