| 1800 | } |
| 1801 | |
| 1802 | void git_configset_clear(struct config_set *set) |
| 1803 | { |
| 1804 | struct config_set_element *entry; |
| 1805 | struct hashmap_iter iter; |
| 1806 | if (!set->hash_initialized) |
| 1807 | return; |
| 1808 | |
| 1809 | hashmap_for_each_entry(&set->config_hash, &iter, entry, |
| 1810 | ent /* member name */) { |
| 1811 | free(entry->key); |
| 1812 | string_list_clear(&entry->value_list, 1); |
| 1813 | } |
| 1814 | hashmap_clear_and_free(&set->config_hash, struct config_set_element, ent); |
| 1815 | set->hash_initialized = 0; |
| 1816 | free(set->list.items); |
| 1817 | set->list.nr = 0; |
| 1818 | set->list.alloc = 0; |
| 1819 | set->list.items = NULL; |
| 1820 | } |
| 1821 | |
| 1822 | static int config_set_callback(const char *key, const char *value, |
| 1823 | const struct config_context *ctx, |