Skip to content

Commit 32d8050

Browse files
Lea Wiemanngitster
authored andcommitted
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>
1 parent 850d3a7 commit 32d8050

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

perl/Git.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ sub config {
565565
my $E = shift;
566566
if ($E->value() == 1) {
567567
# Key not found.
568-
return undef;
568+
return;
569569
} else {
570570
throw $E;
571571
}

0 commit comments

Comments
 (0)