Re: [PATCH v4 2/5] notes.c: replace `git_config()` with `git_config_get_value_multi()`

2014-07-31 Thread Tanay Abhra
On 7/31/2014 5:08 PM, Matthieu Moy wrote: > Matthieu Moy writes: > >> Tanay Abhra writes: >> >>> On 7/30/2014 7:43 PM, Matthieu Moy wrote: * if (!values->items[i].string) config_error_nonbool( => This check could be done once and for all in a function, say

Re: [PATCH v4 2/5] notes.c: replace `git_config()` with `git_config_get_value_multi()`

2014-07-31 Thread Matthieu Moy
Matthieu Moy writes: > Tanay Abhra writes: > >> On 7/30/2014 7:43 PM, Matthieu Moy wrote: >>> * if (!values->items[i].string) >>> config_error_nonbool( >>> >>> => This check could be done once and for all in a function, say >>> git_config_get_value_multi_nonbool, a trivial wrapper

Re: [PATCH v4 2/5] notes.c: replace `git_config()` with `git_config_get_value_multi()`

2014-07-30 Thread Matthieu Moy
Tanay Abhra writes: > On 7/30/2014 7:43 PM, Matthieu Moy wrote: >> Tanay Abhra writes: >> >>> - git_config(notes_display_config, &load_config_refs); >>> + if (load_config_refs) { >>> + values = git_config_get_value_multi("notes.displayref"); >>> + if (values) { >>> +

Re: [PATCH v4 2/5] notes.c: replace `git_config()` with `git_config_get_value_multi()`

2014-07-30 Thread Tanay Abhra
On 7/30/2014 7:43 PM, Matthieu Moy wrote: > Tanay Abhra writes: > >> -git_config(notes_display_config, &load_config_refs); >> +if (load_config_refs) { >> +values = git_config_get_value_multi("notes.displayref"); >> +if (values) { >> +for (i =

Re: [PATCH v4 2/5] notes.c: replace `git_config()` with `git_config_get_value_multi()`

2014-07-30 Thread Matthieu Moy
Tanay Abhra writes: > - git_config(notes_display_config, &load_config_refs); > + if (load_config_refs) { > + values = git_config_get_value_multi("notes.displayref"); > + if (values) { > + for (i = 0; i < values->nr; i++) { > +

[PATCH v4 2/5] notes.c: replace `git_config()` with `git_config_get_value_multi()`

2014-07-30 Thread Tanay Abhra
Use `git_config_get_value_multi()` instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow, also previously 'string_list_add_refs_by_glob()' was called even when the retrieved value was NULL, correct it while we are at it. Signed-off-by: Tanay Abhra