From: Vincent Pit Date: Wed, 24 Feb 2010 15:09:29 +0000 (+0100) Subject: Make the path to the git executable absolute in App::Rgit::Config->new X-Git-Tag: v0.07~10 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=e295d1865b0480223b82fe2373ba79cf5485466e;p=perl%2Fmodules%2Frgit.git Make the path to the git executable absolute in App::Rgit::Config->new --- diff --git a/lib/App/Rgit/Config.pm b/lib/App/Rgit/Config.pm index a784efb..dd6dff2 100644 --- a/lib/App/Rgit/Config.pm +++ b/lib/App/Rgit/Config.pm @@ -58,6 +58,7 @@ sub new { } else { return unless -x $git; } + $git = abs_path $git unless file_name_is_absolute $git; my $conf = 'App::Rgit::Config::Default'; eval "require $conf; 1" or Carp::confess("Couldn't load $conf: $@"); diff --git a/t/20-each.t b/t/20-each.t index 346f755..aa978cd 100644 --- a/t/20-each.t +++ b/t/20-each.t @@ -4,7 +4,7 @@ use strict; use warnings; use Cwd qw/cwd abs_path/; -use File::Spec::Functions qw/catdir catfile/; +use File::Spec::Functions qw/curdir catdir catfile/; use File::Temp qw/tempfile tempdir/; use Test::More; @@ -129,7 +129,7 @@ sub try { ); my $ar = App::Rgit->new( - git => abs_path('t/bin/git'), + git => catfile(curdir, qw/t bin git/), root => $tmpdir, cmd => $cmd, args => [ abs_path($filename), $cmd, qw/%n %g %w %b %G %W %B %R %%n %x/ ], diff --git a/t/lib/App/Rgit/TestUtils.pm b/t/lib/App/Rgit/TestUtils.pm index dcc8339..de5b808 100644 --- a/t/lib/App/Rgit/TestUtils.pm +++ b/t/lib/App/Rgit/TestUtils.pm @@ -3,9 +3,10 @@ package App::Rgit::TestUtils; use strict; use warnings; -use Cwd qw/abs_path/; -use File::Temp qw/tempfile/; -use POSIX qw/WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG SIGINT SIGQUIT/; +use Cwd qw/abs_path/; +use File::Temp qw/tempfile/; +use File::Spec::Functions qw/curdir catfile/; +use POSIX qw/WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG/; BEGIN { no warnings 'redefine'; @@ -30,7 +31,7 @@ TRY: 'version', ); - my $git = 't/bin/git'; + my $git = catfile(curdir, qw/t bin git/); if ($^O eq 'MSWin32') { unless (-x $git) { $git .= '.bat';