Util.pm: add git_bool function
commit16d371440df14473a38522534b3dc7532168f999
authorKyle J. McKay <mackyle@gmail.com>
Wed, 16 Nov 2016 05:40:37 +0000 (15 21:40 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 16 Nov 2016 05:40:37 +0000 (15 21:40 -0800)
tree443e4b5771b8e231b3dc4a1f3911e4e3e3605645
parent93ad841b11c6be360db5ab5a4b9f1aae24bb363c
Util.pm: add git_bool function

Most helpful for interpreting a "boolean" value according to
Git semantics when dealing with read_config_file/read_config_file_hash
output.

Translates a value according to Git boolean semantics into either 0 or 1
or returns undef if it's not a boolean according to Git.

The "undef" value can be treated as true by passing an optional second
parameter that's true.  This can be helpful when dealing with raw
read_config_file output where valueless booleans present with an undef value.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Util.pm