OSDN Git Service

Merge branch 'pb/maint-git-pm-false-dir' into maint
authorJunio C Hamano <gitster@pobox.com>
Sat, 24 Jan 2009 03:02:41 +0000 (19:02 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 24 Jan 2009 03:02:41 +0000 (19:02 -0800)
* pb/maint-git-pm-false-dir:
  Git.pm: correctly handle directory name that evaluates to "false"

1  2 
perl/Git.pm

diff --combined perl/Git.pm
@@@ -166,11 -166,12 +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});
@@@ -1010,8 -1011,8 +1011,8 @@@ sub _temp_cache 
        my $temp_fd = \$TEMP_FILEMAP{$name};
        if (defined $$temp_fd and $$temp_fd->opened) {
                if ($TEMP_FILES{$$temp_fd}{locked}) {
 -                      throw Error::Simple("Temp file with moniker '",
 -                              $name, "' already in use");
 +                      throw Error::Simple("Temp file with moniker '" .
 +                              $name . "' already in use");
                }
        } else {
                if (defined $$temp_fd) {