summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-01-23 19:02:41 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-01-23 19:02:41 -0800
commite5bde1987c1ddaf2416011b9529a73eb174f5d21 (patch)
tree1af5851d16aca51ba3a21921b560d19f6f9e508e
parentMerge branch 'js/maint-bisect-gitk' into maint (diff)
parentGit.pm: correctly handle directory name that evaluates to "false" (diff)
downloadtgif-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"
-rw-r--r--perl/Git.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index e9f8c9c048..7d7f2b1d36 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});