]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Git.pm: fix return value of config method
authorLea Wiemann <lewiemann@gmail.com>
Sun, 1 Jun 2008 20:34:47 +0000 (22:34 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Jun 2008 05:28:27 +0000 (22:28 -0700)
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>
perl/Git.pm

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