aboutsummaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-23 19:02:41 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-23 19:02:41 -0800
commite5bde1987c1ddaf2416011b9529a73eb174f5d21 (patch)
tree1af5851d16aca51ba3a21921b560d19f6f9e508e /perl
parente2355a3e061eb7c9583a992f677867deb97fd598 (diff)
parent11b8a41c4569e99a57137cb2db4b642b57171797 (diff)
downloadgit-e5bde1987c1ddaf2416011b9529a73eb174f5d21.tar.gz
git-e5bde1987c1ddaf2416011b9529a73eb174f5d21.tar.xz
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"
Diffstat (limited to 'perl')
-rw-r--r--perl/Git.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index e9f8c9c04..7d7f2b1d3 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});