| 1343 | } |
| 1344 | |
| 1345 | static int run_apply_check(struct add_p_state *s, |
| 1346 | struct file_diff *file_diff) |
| 1347 | { |
| 1348 | struct child_process cp = CHILD_PROCESS_INIT; |
| 1349 | |
| 1350 | strbuf_reset(&s->buf); |
| 1351 | reassemble_patch(s, file_diff, 1, &s->buf); |
| 1352 | |
| 1353 | setup_child_process(s, &cp, |
| 1354 | "apply", "--check", NULL); |
| 1355 | strvec_pushv(&cp.args, s->mode->apply_check_args); |
| 1356 | if (pipe_command(&cp, s->buf.buf, s->buf.len, NULL, 0, NULL, 0)) |
| 1357 | return error(_("'git apply --cached' failed")); |
| 1358 | |
| 1359 | return 0; |
| 1360 | } |
| 1361 | |
| 1362 | static int read_single_character(struct add_p_state *s) |
| 1363 | { |
no test coverage detected