From: Vincent Pit Date: Mon, 6 Oct 2008 15:49:38 +0000 (+0200) Subject: In App::Rgit::Repository::new, only make the directory absolute if it's not already X-Git-Tag: v0.03~7 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=a478eb47772af0e18b0b557f7830de989e7cb44d;p=perl%2Fmodules%2Frgit.git In App::Rgit::Repository::new, only make the directory absolute if it's not already --- diff --git a/lib/App/Rgit/Repository.pm b/lib/App/Rgit/Repository.pm index 1b88f5c..83241a1 100644 --- a/lib/App/Rgit/Repository.pm +++ b/lib/App/Rgit/Repository.pm @@ -4,7 +4,7 @@ use strict; 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/; @@ -40,7 +40,7 @@ If the C option is passed, C<$dir> isn't checked to be a valid C repo 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}) {