X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=blobdiff_plain;f=lib%2FApp%2FRgit%2FRepository.pm;h=0ca5e940a692537d136620776cecb421e42461bb;hp=f859f8f06aa5e804f6bde023f9359023da92b89a;hb=a35a1fae17b8e75696ef1e5474aaa99222594a6a;hpb=e295d1865b0480223b82fe2373ba79cf5485466e diff --git a/lib/App/Rgit/Repository.pm b/lib/App/Rgit/Repository.pm index f859f8f..0ca5e94 100644 --- a/lib/App/Rgit/Repository.pm +++ b/lib/App/Rgit/Repository.pm @@ -3,8 +3,8 @@ package App::Rgit::Repository; use strict; use warnings; -use Cwd qw/cwd abs_path/; -use File::Spec::Functions qw/canonpath catdir splitdir abs2rel file_name_is_absolute/; +use Cwd qw/cwd abs_path/; +use File::Spec::Functions qw/canonpath catdir splitdir abs2rel/; use POSIX qw/WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG SIGINT SIGQUIT/; BEGIN { @@ -48,9 +48,12 @@ sub new { my %args = @_; my $dir = $args{dir}; - $dir = abs_path $dir if defined $dir and not file_name_is_absolute $dir; - $dir = cwd unless defined $dir; - $dir = canonpath $dir; + if (defined $dir) { + $dir = abs_path $dir; + } else { + $dir = cwd; + } + $dir = canonpath $dir; my ($repo, $bare, $name, $work); if ($args{fake}) {