]> git.ipfire.org Git - thirdparty/git.git/commit - branch.c
branch.c: replace `git_config()` with `git_config_get_string()
authorTanay Abhra <tanayabh@gmail.com>
Thu, 7 Aug 2014 17:56:42 +0000 (23:26 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Aug 2014 20:33:29 +0000 (13:33 -0700)
commit540b0f497701fca2749de86c58bc16f44fcb30b5
tree0f9bc71e6a82b5645a609a9096e58889262f2b6d
parent111791559e69011a6d55f053393d154a1840b4f5
branch.c: replace `git_config()` with `git_config_get_string()

Use `git_config_get_string()` instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow. While we are at
it, return -1 if we find no value for the queried variable. Original code
returned 0 for all cases, which was checked by `add_branch_desc()` in
fmt-merge-msg.c resulting in addition of a spurious newline to the `out`
strbuf. Now, the newline addition is skipped as -1 is returned to the caller
if no value is found.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c