Git.pm: correctly handle directory name that evaluates to "false"
The repository constructor mistakenly rewrote a Directory parameter that Perl happens to evaluate to false (e.g. "0") to ".". Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d99bf51add
commit
11b8a41c45
@ -166,11 +166,12 @@ sub repository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not defined $opts{Repository} and not defined $opts{WorkingCopy}) {
|
if (not defined $opts{Repository} and not defined $opts{WorkingCopy}
|
||||||
$opts{Directory} ||= '.';
|
and not defined $opts{Directory}) {
|
||||||
|
$opts{Directory} = '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($opts{Directory}) {
|
if (defined $opts{Directory}) {
|
||||||
-d $opts{Directory} or throw Error::Simple("Directory not found: $!");
|
-d $opts{Directory} or throw Error::Simple("Directory not found: $!");
|
||||||
|
|
||||||
my $search = Git->repository(WorkingCopy => $opts{Directory});
|
my $search = Git->repository(WorkingCopy => $opts{Directory});
|
||||||
|
Reference in New Issue
Block a user