Re: [PATCH 1/4] Git.pm: config_boolean() -> config_bool()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Petr Baudis <pasky@xxxxxxx> 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?

> @@ -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?

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]