Browse Source

Git.pm: fix return value of config method

If config is called in array context, it is supposed to return all
values set for the given option key.  This works for all cases except
if there is no value set at all.  In that case, it wrongly returns
(undef) instead of ().  This fixes the return statement so that it
returns undef in scalar context but an empty array in array context.

Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Lea Wiemann 17 years ago committed by Junio C Hamano
parent
commit
32d8050a86
  1. 2
      perl/Git.pm

2
perl/Git.pm

@ -565,7 +565,7 @@ sub config { @@ -565,7 +565,7 @@ sub config {
my $E = shift;
if ($E->value() == 1) {
# Key not found.
return undef;
return;
} else {
throw $E;
}

Loading…
Cancel
Save