MCPcopy Index your code
hub / github.com/git/git / string_list_remove

Function string_list_remove

string-list.c:70–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void string_list_remove(struct string_list *list, const char *string,
71 int free_util)
72{
73 bool exact_match;
74 int i = get_entry_index(list, string, &exact_match);
75
76 if (exact_match) {
77 if (list->strdup_strings)
78 free(list->items[i].string);
79 if (free_util)
80 free(list->items[i].util);
81
82 list->nr--;
83 MOVE_ARRAY(list->items + i, list->items + i + 1, list->nr - i);
84 }
85}
86
87bool string_list_has_string(const struct string_list *list, const char *string)
88{

Callers 6

list_cmds_by_configFunction · 0.85
do_plain_rerereFunction · 0.85
prep_childenvFunction · 0.85
t_string_list_removeFunction · 0.85
handle_commitFunction · 0.85

Calls 1

get_entry_indexFunction · 0.85

Tested by

no test coverage detected