| 1510 | |
| 1511 | #define DISPLAY_HUNKS_LINES 20 |
| 1512 | static size_t display_hunks(struct add_p_state *s, |
| 1513 | struct file_diff *file_diff, size_t start_index) |
| 1514 | { |
| 1515 | size_t end_index = start_index + DISPLAY_HUNKS_LINES; |
| 1516 | |
| 1517 | if (end_index > file_diff->hunk_nr) |
| 1518 | end_index = file_diff->hunk_nr; |
| 1519 | |
| 1520 | while (start_index < end_index) { |
| 1521 | struct hunk *hunk = file_diff->hunk + start_index++; |
| 1522 | |
| 1523 | strbuf_reset(&s->buf); |
| 1524 | strbuf_addf(&s->buf, "%c%2d: ", hunk->use == USE_HUNK ? '+' |
| 1525 | : hunk->use == SKIP_HUNK ? '-' : ' ', |
| 1526 | (int)start_index); |
| 1527 | summarize_hunk(s, hunk, &s->buf); |
| 1528 | fputs(s->buf.buf, stdout); |
| 1529 | } |
| 1530 | |
| 1531 | return end_index; |
| 1532 | } |
| 1533 | |
| 1534 | static const char help_patch_remainder[] = |
| 1535 | N_("j - go to the next undecided hunk, roll over at the bottom\n" |
no test coverage detected