Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:07

Possibly related (same subject, not in this thread)

Petr Baudis [off-list ref] 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?
quoted hunk
@@ -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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help