| 1834 | } |
| 1835 | |
| 1836 | int git_configset_get_value(struct config_set *set, const char *key, |
| 1837 | const char **value, struct key_value_info *kvi) |
| 1838 | { |
| 1839 | const struct string_list *values = NULL; |
| 1840 | int ret; |
| 1841 | struct string_list_item item; |
| 1842 | /* |
| 1843 | * Follows "last one wins" semantic, i.e., if there are multiple matches for the |
| 1844 | * queried key in the files of the configset, the value returned will be the last |
| 1845 | * value in the value list for that key. |
| 1846 | */ |
| 1847 | if ((ret = git_configset_get_value_multi(set, key, &values))) |
| 1848 | return ret; |
| 1849 | |
| 1850 | assert(values->nr > 0); |
| 1851 | item = values->items[values->nr - 1]; |
| 1852 | *value = item.string; |
| 1853 | if (kvi) |
| 1854 | *kvi = *((struct key_value_info *)item.util); |
| 1855 | return 0; |
| 1856 | } |
| 1857 | |
| 1858 | int git_configset_get_value_multi(struct config_set *set, const char *key, |
| 1859 | const struct string_list **dest) |