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

Function prompt_yesno

add-patch.c:1375–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373}
1374
1375static int prompt_yesno(struct add_p_state *s, const char *prompt)
1376{
1377 for (;;) {
1378 color_fprintf(stdout, s->cfg.prompt_color, "%s", _(prompt));
1379 fflush(stdout);
1380 if (read_single_character(s) == EOF)
1381 return -1;
1382 /* do not limit to 1-byte input to allow 'no' etc. */
1383 switch (tolower(s->answer.buf[0])) {
1384 case 'n': return 0;
1385 case 'y': return 1;
1386 }
1387 }
1388}
1389
1390static int edit_hunk_loop(struct add_p_state *s,
1391 struct file_diff *file_diff, struct hunk *hunk)

Callers 2

edit_hunk_loopFunction · 0.85
apply_for_checkoutFunction · 0.85

Calls 2

color_fprintfFunction · 0.85
read_single_characterFunction · 0.85

Tested by

no test coverage detected