Skip to content

Commit

Permalink
Git.pm: fix return value of config method
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Lea Wiemann authored and gitster committed Jun 2, 2008
1 parent 850d3a7 commit 32d8050
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion perl/Git.pm
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ sub config {
my $E = shift;
if ($E->value() == 1) {
# Key not found.
return undef;
return;
} else {
throw $E;
}
Expand Down

0 comments on commit 32d8050

Please sign in to comment.