]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit/Repository.pm
Always canonify the root, the git path and the repo directory
[perl/modules/rgit.git] / lib / App / Rgit / Repository.pm
index 15cf6274b74a1641b610ac5bfd123897b81302fd..0ca5e940a692537d136620776cecb421e42461bb 100644 (file)
@@ -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}) {
@@ -211,7 +214,7 @@ You can find documentation for this module with the perldoc command.
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2008-2009 Vincent Pit, all rights reserved.
+Copyright 2008,2009,2010 Vincent Pit, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.