| 547 | #define AUTOCORRECT_IMMEDIATELY (-1) |
| 548 | |
| 549 | static int parse_autocorrect(const char *value) |
| 550 | { |
| 551 | switch (git_parse_maybe_bool_text(value)) { |
| 552 | case 1: |
| 553 | return AUTOCORRECT_IMMEDIATELY; |
| 554 | case 0: |
| 555 | return AUTOCORRECT_SHOW; |
| 556 | default: /* other random text */ |
| 557 | break; |
| 558 | } |
| 559 | |
| 560 | if (!strcmp(value, "prompt")) |
| 561 | return AUTOCORRECT_PROMPT; |
| 562 | if (!strcmp(value, "never")) |
| 563 | return AUTOCORRECT_NEVER; |
| 564 | if (!strcmp(value, "immediate")) |
| 565 | return AUTOCORRECT_IMMEDIATELY; |
| 566 | if (!strcmp(value, "show")) |
| 567 | return AUTOCORRECT_SHOW; |
| 568 | |
| 569 | return 0; |
| 570 | } |
| 571 | |
| 572 | static int git_unknown_cmd_config(const char *var, const char *value, |
| 573 | const struct config_context *ctx, |
no test coverage detected