Re: [PATCH 1/4] Git.pm: config_boolean() -> config_bool()
Petr Baudis <pasky@suse.cz> writes:
> This patch renames config_boolean() to config_bool() for consistency with
> the commandline interface and because it is shorter but still obvious. ;-)
> It also changes the return value from some obscure string to real Perl
> boolean, allowing for clean user code.
Doesn't this break send-email?
Show 16 quoted lines
> @@ -526,14 +528,16 @@ This currently wraps command('config') s
>
> =cut
>
> -sub config_boolean {
> +sub config_bool {
> my ($self, $var) = @_;
> $self->repo_path()
> or throw Error::Simple("not a repository");
>
> try {
> - return $self->command_oneline('config', '--bool', '--get',
> + my $var = $self->command_oneline('config', '--bool', '--get',
> $var);
> + return undef unless defined $var;
> + return $var eq 'true';Did you mean to hide $var in the nested scope?