git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Git.pm: let a false Directory parameter (such as 0) be used correctly by the constructor
@ 2009-01-02  8:47 Philippe Bruhat (BooK)
  2009-01-02  9:09 ` Philippe Bruhat (BooK)
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Bruhat (BooK) @ 2009-01-02  8:47 UTC (permalink / raw)
  To: git; +Cc: gitster, Philippe Bruhat (BooK)

Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Git.pm: let a false Directory parameter (such as 0) be used correctly by the constructor
  2009-01-02  8:47 [PATCH] Git.pm: let a false Directory parameter (such as 0) be used correctly by the constructor Philippe Bruhat (BooK)
@ 2009-01-02  9:09 ` Philippe Bruhat (BooK)
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Bruhat (BooK) @ 2009-01-02  9:09 UTC (permalink / raw)
  To: Philippe Bruhat (BooK); +Cc: git, gitster

On Fri, Jan 02, 2009 at 09:47:37AM +0100, Philippe Bruhat (BooK) wrote:
> Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org>
> ---
>  perl/Git.pm |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)

Please ignore, I forgot half of the the requested changes. Sorry for the
noise.

-- 
 Philippe Bruhat (BooK)

 Mankind is the story of the same mistakes in different places.
                                                 (Moral from Groo #1 (Image))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-02  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-02  8:47 [PATCH] Git.pm: let a false Directory parameter (such as 0) be used correctly by the constructor Philippe Bruhat (BooK)
2009-01-02  9:09 ` Philippe Bruhat (BooK)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).