From: Vincent Pit Date: Tue, 7 Oct 2008 20:50:24 +0000 (+0200) Subject: Test it, and prevent an undefined warning with fake repos X-Git-Tag: v0.04~3 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=commitdiff_plain;h=313864be3ae1c0d2120b434ff18150c53f8b352e Test it, and prevent an undefined warning with fake repos --- diff --git a/lib/App/Rgit/Repository.pm b/lib/App/Rgit/Repository.pm index f5c01b5..ec96328 100644 --- a/lib/App/Rgit/Repository.pm +++ b/lib/App/Rgit/Repository.pm @@ -45,7 +45,7 @@ sub new { $dir = cwd unless defined $dir; my ($repo, $bare, $name, $work); if ($args{fake}) { - $work = $dir; + $repo = $work = $dir; } else { my @tries = ($dir); my @chunks = splitdir $dir; diff --git a/t/21-once.t b/t/21-once.t index 4e0c4ac..2a43ca9 100644 --- a/t/21-once.t +++ b/t/21-once.t @@ -14,11 +14,14 @@ my @expected = ( ([ [ qw/^n ^g ^w ^b ^^/ ] ]) x 5 ); +local $ENV{GIT_DIR} = 't'; +local $ENV{GIT_EXEC_PATH} = abs_path('t/bin/git'); + for my $cmd (qw/daemon gui help init version/) { my ($fh, $filename) = tempfile(UNLINK => 1); my $ar = App::Rgit->new( - git => abs_path('t/bin/git'), - root => 't', + git => $ENV{GIT_EXEC_PATH}, + root => $ENV{GIT_DIR}, cmd => $cmd, args => [ abs_path($filename), $cmd, qw/^n ^g ^w ^b ^^/ ] );