MCPcopy Create free account
hub / github.com/git/git / init_apply_state

Function init_apply_state

apply.c:108–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108int 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
137void clear_apply_state(struct apply_state *state)
138{

Callers 2

run_applyFunction · 0.85
cmd_applyFunction · 0.85

Calls 6

string_list_init_nodupFunction · 0.85
strset_initFunction · 0.85
strbuf_initFunction · 0.85
git_apply_configFunction · 0.85
parse_whitespace_optionFunction · 0.85

Tested by

no test coverage detected