{"thread":{"id":"16958","subject":"[PATCH] Git.pm: let a false Directory parameter be used correctly by the constructor","startedAt":"2009-01-02T08:49:30Z","lastAt":"2009-01-02T08:49:30Z","messageCount":1,"participants":["Philippe Bruhat (BooK)"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"99153","messageId":"1230886170-24188-1-git-send-email-book@cpan.org","threadId":"16958","inReplyTo":null,"subject":"[PATCH] Git.pm: let a false Directory parameter be used correctly by the constructor","fromName":"Philippe Bruhat (BooK)","fromEmail":"book@cpan.org","sentAt":"2009-01-02T08:49:30Z","receivedAt":"2009-01-02T08:49:30Z","isPatch":true,"sender":{"key":"book@cpan.org","avatar":"https://avatars.githubusercontent.com/u/44421?v=4"},"body":"The repository constructor mistakenly rewrote a Directory parameter that\nPerl happens to evaluate to false (e.g. \"0\") to \".\".\n\nSigned-off-by: Philippe Bruhat (BooK) <book@cpan.org>\n---\n perl/Git.pm |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 8392a68..ad0f530 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -166,11 +166,12 @@ sub repository {\n \t\t}\n \t}\n \n-\tif (not defined $opts{Repository} and not defined $opts{WorkingCopy}) {\n-\t\t$opts{Directory} ||= '.';\n+\tif (not defined $opts{Repository} and not defined $opts{WorkingCopy}\n+\t\tand not defined $opts{Directory}) {\n+\t\t$opts{Directory} = '.';\n \t}\n \n-\tif ($opts{Directory}) {\n+\tif (defined $opts{Directory}) {\n \t\t-d $opts{Directory} or throw Error::Simple(\"Directory not found: $!\");\n \n \t\tmy $search = Git->repository(WorkingCopy => $opts{Directory});\n-- \n1.6.0.3.517.g759a\n"}]}