From: "Philippe Bruhat (BooK)" <book@cpan.org>
To: git@vger.kernel.org
Cc: "Philippe Bruhat (BooK)" <book@cpan.org>
Subject: [PATCH] Git.pm: let a "false" Directory parameter (such as "0") be used correctly by the constructor"
Date: Mon, 29 Dec 2008 01:25:00 +0100 [thread overview]
Message-ID: <1230510300-7854-1-git-send-email-book@cpan.org> (raw)
---
perl/Git.pm | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index 8392a68..ad0f530 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});
--
1.6.0.3.517.g759a
next reply other threads:[~2008-12-29 0:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-29 0:25 Philippe Bruhat (BooK) [this message]
2009-01-01 21:00 ` [PATCH] Git.pm: let a "false" Directory parameter (such as "0") be used correctly by the constructor" Junio C Hamano
2009-01-02 8:37 ` Philippe Bruhat (BooK)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1230510300-7854-1-git-send-email-book@cpan.org \
--to=book@cpan.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.