mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-19 01:37:32 -05:00
built-in add -i: offer the quit command
We do not really want to `exit()` here, of course, as this is safely libified code. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -992,10 +992,11 @@ int run_add_i(struct repository *r, const struct pathspec *ps)
|
||||
add_untracked = { { "add untracked" }, run_add_untracked },
|
||||
patch = { { "patch" }, run_patch },
|
||||
diff = { { "diff" }, run_diff },
|
||||
quit = { { "quit" }, NULL },
|
||||
help = { { "help" }, run_help };
|
||||
struct command_item *commands[] = {
|
||||
&status, &update, &revert, &add_untracked,
|
||||
&patch, &diff, &help
|
||||
&patch, &diff, &quit, &help
|
||||
};
|
||||
|
||||
struct print_file_item_data print_file_item_data = {
|
||||
@@ -1040,7 +1041,8 @@ int run_add_i(struct repository *r, const struct pathspec *ps)
|
||||
for (;;) {
|
||||
i = list_and_choose((struct prefix_item **)commands, NULL,
|
||||
ARRAY_SIZE(commands), &s, &main_loop_opts);
|
||||
if (i == LIST_AND_CHOOSE_QUIT) {
|
||||
if (i == LIST_AND_CHOOSE_QUIT ||
|
||||
(i != LIST_AND_CHOOSE_ERROR && !commands[i]->command)) {
|
||||
printf(_("Bye.\n"));
|
||||
res = 0;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user