Re: [PATCH v3 2/6] branch.c: replace `git_config()` with `git_config_get_string()`

2014-07-21 Thread Tanay Abhra
On 7/21/2014 11:29 PM, Junio C Hamano wrote: > Tanay Abhra writes: > >> Use `git_config_get_string()` instead of `git_config()` to take advantage of >> the config-set API which provides a cleaner control flow. >> >> Signed-off-by: Tanay Abhra >> --- >> branch.c | 24 >

Re: [PATCH v3 2/6] branch.c: replace `git_config()` with `git_config_get_string()`

2014-07-21 Thread Matthieu Moy
Junio C Hamano writes: > Tanay Abhra writes: > >> -if (cb.value) >> -strbuf_addstr(buf, cb.value); >> +strbuf_addstr(buf, v); >> +free((char*)v); > > In this cast, I smell an API mistake to insist an extra constness to > the output parameter of git_config_get_string() in

Re: [PATCH v3 2/6] branch.c: replace `git_config()` with `git_config_get_string()`

2014-07-21 Thread Junio C Hamano
Tanay Abhra writes: > Use `git_config_get_string()` instead of `git_config()` to take advantage of > the config-set API which provides a cleaner control flow. > > Signed-off-by: Tanay Abhra > --- > branch.c | 24 > 1 file changed, 4 insertions(+), 20 deletions(-) > > di

[PATCH v3 2/6] branch.c: replace `git_config()` with `git_config_get_string()`

2014-07-21 Thread Tanay Abhra
Use `git_config_get_string()` instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. Signed-off-by: Tanay Abhra --- branch.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/branch.c b/branch.c index 4