]> git.ipfire.org Git - thirdparty/git.git/commit
parse: prefer bool to int for boolean returns
authorJeff King <peff@peff.net>
Sun, 30 Nov 2025 13:14:41 +0000 (08:14 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 30 Nov 2025 18:03:42 +0000 (10:03 -0800)
commitfa4fe12fa0a2b393b818d4a1abdd9b0eb2f3e022
tree9ebdfb32ff173a9e4e323946e84bd62071ba9cf4
parent9841b05cbce103eb7d73c36628f2ed846c1656ef
parse: prefer bool to int for boolean returns

All of the integer parsing functions in parse.[ch] return an int that is
"0" for failure or "1" for success. Since most of the other functions in
Git use "0" for success and "-1" for failure, this can be confusing.
Let's switch the return types to bool to make it clear that we are using
this other convention. Callers should not need to update at all.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse.c
parse.h