| 774 | } |
| 775 | |
| 776 | static int ask_each_cmd(void) |
| 777 | { |
| 778 | struct strbuf confirm = STRBUF_INIT; |
| 779 | struct strbuf buf = STRBUF_INIT; |
| 780 | struct string_list_item *item; |
| 781 | const char *qname; |
| 782 | int changed = 0, eof = 0; |
| 783 | |
| 784 | for_each_string_list_item(item, &del_list) { |
| 785 | /* Ctrl-D should stop removing files */ |
| 786 | if (!eof) { |
| 787 | qname = quote_path(item->string, NULL, &buf, 0); |
| 788 | /* TRANSLATORS: Make sure to keep [y/N] as is */ |
| 789 | printf(_("Remove %s [y/N]? "), qname); |
| 790 | if (git_read_line_interactively(&confirm) == EOF) { |
| 791 | putchar('\n'); |
| 792 | eof = 1; |
| 793 | } |
| 794 | } |
| 795 | if (!confirm.len || strncasecmp(confirm.buf, "yes", confirm.len)) { |
| 796 | *item->string = '\0'; |
| 797 | changed++; |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | if (changed) |
| 802 | string_list_remove_empty_items(&del_list, 0); |
| 803 | |
| 804 | strbuf_release(&buf); |
| 805 | strbuf_release(&confirm); |
| 806 | return MENU_RETURN_NO_LOOP; |
| 807 | } |
| 808 | |
| 809 | static int quit_cmd(void) |
| 810 | { |
nothing calls this directly
no test coverage detected