]> git.vpit.fr Git - perl/modules/rgit.git/commitdiff
In App::Rgit::Repository::new, only make the directory absolute if it's not already
authorVincent Pit <vince@profvince.com>
Mon, 6 Oct 2008 15:49:38 +0000 (17:49 +0200)
committerVincent Pit <vince@profvince.com>
Mon, 6 Oct 2008 15:49:38 +0000 (17:49 +0200)
lib/App/Rgit/Repository.pm

index 1b88f5cb91efabf1e8adf8e5d37b2a7f6775999b..83241a15d941d0c9fb3d13ca1a38b8c2ecc321ea 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 use Cwd qw/cwd abs_path/;
 use warnings;
 
 use Cwd qw/cwd abs_path/;
-use File::Spec::Functions qw/catdir splitdir abs2rel/;
+use File::Spec::Functions qw/catdir splitdir abs2rel file_name_is_absolute/;
 
 use Object::Tiny qw/fake repo bare name work/;
 
 
 use Object::Tiny qw/fake repo bare name work/;
 
@@ -40,7 +40,7 @@ If the C<fake> option is passed, C<$dir> isn't checked to be a valid C<git> repo
 sub new {
  my ($class, %args) = &validate;
  my $dir = $args{dir};
 sub new {
  my ($class, %args) = &validate;
  my $dir = $args{dir};
- $dir = abs_path $dir if defined $dir;
+ $dir = abs_path $dir if defined $dir and not file_name_is_absolute $dir;
  $dir = cwd       unless defined $dir;
  my ($repo, $bare, $name, $work);
  if ($args{fake}) {
  $dir = cwd       unless defined $dir;
  my ($repo, $bare, $name, $work);
  if ($args{fake}) {