Merge branch 'pb/maint-git-pm-false-dir' into maint

* pb/maint-git-pm-false-dir:
  Git.pm: correctly handle directory name that evaluates to "false"
This commit is contained in:
Junio C Hamano 2009-01-23 19:02:41 -08:00
Родитель e2355a3e06 11b8a41c45
Коммит e5bde1987c
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -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});