diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-01-23 19:02:41 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-23 19:02:41 -0800 |
commit | e5bde1987c1ddaf2416011b9529a73eb174f5d21 (patch) | |
tree | 1af5851d16aca51ba3a21921b560d19f6f9e508e /perl/Git.pm | |
parent | Merge branch 'js/maint-bisect-gitk' into maint (diff) | |
parent | Git.pm: correctly handle directory name that evaluates to "false" (diff) | |
download | tgif-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/Git.pm')
-rw-r--r-- | perl/Git.pm | 7 |
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}); |