aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLea Wiemann <lewiemann@gmail.com>2008-06-01 22:34:47 +0200
committerJunio C Hamano <gitster@pobox.com>2008-06-01 22:28:27 -0700
commit32d8050a86f8de0253430b12711354e66a317f29 (patch)
tree8abbdcd2a0d1a630b735579c9bf48f101b76bde6
parent850d3a7c05b4678af21b126ad30bc60510745ef1 (diff)
downloadgit-32d8050a86f8de0253430b12711354e66a317f29.tar.gz
git-32d8050a86f8de0253430b12711354e66a317f29.tar.xz
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>
-rw-r--r--perl/Git.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index e2141b638..97e61efaf 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -565,7 +565,7 @@ sub config {
my $E = shift;
if ($E->value() == 1) {
# Key not found.
- return undef;
+ return;
} else {
throw $E;
}