| 55 | } |
| 56 | |
| 57 | static int parse_whitespace_option(struct apply_state *state, const char *option) |
| 58 | { |
| 59 | if (!option) { |
| 60 | state->ws_error_action = warn_on_ws_error; |
| 61 | return 0; |
| 62 | } |
| 63 | if (!strcmp(option, "warn")) { |
| 64 | state->ws_error_action = warn_on_ws_error; |
| 65 | return 0; |
| 66 | } |
| 67 | if (!strcmp(option, "nowarn")) { |
| 68 | state->ws_error_action = nowarn_ws_error; |
| 69 | return 0; |
| 70 | } |
| 71 | if (!strcmp(option, "error")) { |
| 72 | state->ws_error_action = die_on_ws_error; |
| 73 | return 0; |
| 74 | } |
| 75 | if (!strcmp(option, "error-all")) { |
| 76 | state->ws_error_action = die_on_ws_error; |
| 77 | state->squelch_whitespace_errors = 0; |
| 78 | return 0; |
| 79 | } |
| 80 | if (!strcmp(option, "strip") || !strcmp(option, "fix")) { |
| 81 | state->ws_error_action = correct_ws_error; |
| 82 | return 0; |
| 83 | } |
| 84 | /* |
| 85 | * Please update $__git_whitespacelist in git-completion.bash, |
| 86 | * Documentation/git-apply.adoc, and Documentation/git-am.adoc |
| 87 | * when you add new options. |
| 88 | */ |
| 89 | return error(_("unrecognized whitespace option '%s'"), option); |
| 90 | } |
| 91 | |
| 92 | static int parse_ignorewhitespace_option(struct apply_state *state, |
| 93 | const char *option) |
no test coverage detected