Skip to content

Commit

Permalink
Merge branch 'pb/maint-git-pm-false-dir' into maint
Browse files Browse the repository at this point in the history
* pb/maint-git-pm-false-dir:
  Git.pm: correctly handle directory name that evaluates to "false"
  • Loading branch information
Junio C Hamano committed Jan 24, 2009
2 parents e2355a3 + 11b8a41 commit e5bde19
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions perl/Git.pm
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,12 @@ sub repository {
}
}

if (not defined $opts{Repository} and not defined $opts{WorkingCopy}) {
$opts{Directory} ||= '.';
if (not defined $opts{Repository} and not defined $opts{WorkingCopy}
and not defined $opts{Directory}) {
$opts{Directory} = '.';
}

if ($opts{Directory}) {
if (defined $opts{Directory}) {
-d $opts{Directory} or throw Error::Simple("Directory not found: $!");

my $search = Git->repository(WorkingCopy => $opts{Directory});
Expand Down

0 comments on commit e5bde19

Please sign in to comment.