| 106 | } |
| 107 | |
| 108 | int init_apply_state(struct apply_state *state, |
| 109 | struct repository *repo, |
| 110 | const char *prefix) |
| 111 | { |
| 112 | memset(state, 0, sizeof(*state)); |
| 113 | state->prefix = prefix; |
| 114 | state->repo = repo; |
| 115 | state->apply = 1; |
| 116 | state->line_termination = '\n'; |
| 117 | state->p_value = 1; |
| 118 | state->p_context = UINT_MAX; |
| 119 | state->squelch_whitespace_errors = 5; |
| 120 | state->ws_error_action = warn_on_ws_error; |
| 121 | state->ws_ignore_action = ignore_ws_none; |
| 122 | state->linenr = 1; |
| 123 | string_list_init_nodup(&state->fn_table); |
| 124 | string_list_init_nodup(&state->limit_by_name); |
| 125 | strset_init(&state->removed_symlinks); |
| 126 | strset_init(&state->kept_symlinks); |
| 127 | strbuf_init(&state->root, 0); |
| 128 | |
| 129 | git_apply_config(); |
| 130 | if (apply_default_whitespace && parse_whitespace_option(state, apply_default_whitespace)) |
| 131 | return -1; |
| 132 | if (apply_default_ignorewhitespace && parse_ignorewhitespace_option(state, apply_default_ignorewhitespace)) |
| 133 | return -1; |
| 134 | return 0; |
| 135 | } |
| 136 | |
| 137 | void clear_apply_state(struct apply_state *state) |
| 138 | { |
no test coverage detected