use strict;
use warnings;
-use Carp ();
-use Cwd qw/abs_path/;
-use File::Spec::Functions qw/file_name_is_absolute/;
+use Carp ();
+use Cwd qw/abs_path/;
+use File::Spec::Functions qw/canonpath/;
use App::Rgit::Repository;
use App::Rgit::Utils qw/:levels/;
my $root = $args{root};
return unless defined $root and -d $root;
- $root = abs_path $root unless file_name_is_absolute $root;
+ $root = canonpath abs_path $root;
my $git = $args{git};
return unless defined $git;
} else {
return unless -x $git;
}
- $git = abs_path $git unless file_name_is_absolute $git;
+ $git = canonpath abs_path $git;
my $conf = 'App::Rgit::Config::Default';
eval "require $conf; 1" or Carp::confess("Couldn't load $conf: $@");
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 {
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}) {
use warnings;
use Cwd qw/cwd abs_path/;
-use File::Spec::Functions qw/curdir catdir catfile/;
+use File::Spec::Functions qw/catdir catfile/;
use File::Temp qw/tempfile tempdir/;
use Test::More;
);
my $ar = App::Rgit->new(
- git => catfile(curdir, qw/t bin git/),
+ git => 't/bin/git',
root => $tmpdir,
cmd => $cmd,
args => [ abs_path($filename), $cmd, qw/%n %g %w %b %G %W %B %R %%n %x/ ],
);
local $ENV{GIT_DIR} = 't';
-local $ENV{GIT_EXEC_PATH} = abs_path('t/bin/git');
+local $ENV{GIT_EXEC_PATH} = 't/bin/git';
for my $cmd (qw/daemon gui help init version/) {
my ($fh, $filename) = tempfile(UNLINK => 1);