Skip to content

Commit e5bde19

Browse files
committed
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"
2 parents e2355a3 + 11b8a41 commit e5bde19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

perl/Git.pm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,12 @@ sub repository {
166166
}
167167
}
168168

169-
if (not defined $opts{Repository} and not defined $opts{WorkingCopy}) {
170-
$opts{Directory} ||= '.';
169+
if (not defined $opts{Repository} and not defined $opts{WorkingCopy}
170+
and not defined $opts{Directory}) {
171+
$opts{Directory} = '.';
171172
}
172173

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

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

0 commit comments

Comments
 (0)