summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-01-13 23:09:42 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-01-13 23:09:42 -0800
commit4d8e6e1d7967206826edcfa2c70d262336926f56 (patch)
treeee7970a657c987886f767ae7782062e0a0e4fd3c
parentMerge branch 'pj/maint-ldflags' (diff)
parentGit.pm: correctly handle directory name that evaluates to "false" (diff)
downloadtgif-4d8e6e1d7967206826edcfa2c70d262336926f56.tar.xz
Merge branch 'pb/maint-git-pm-false-dir'
* pb/maint-git-pm-false-dir: Git.pm: correctly handle directory name that evaluates to "false"
-rw-r--r--perl/Git.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index 8392a68333..ad0f530445 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -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});