X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit%2FRepository.pm;h=c7981004ffcfb97719567c4db490db87a3111c96;hb=refs%2Ftags%2Fv0.04;hp=50cc9d015ff9dd6585f3499274582ed5e27be26d;hpb=a43b4096bf0350b564465090554317935a84e7ef;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit/Repository.pm b/lib/App/Rgit/Repository.pm index 50cc9d0..c798100 100644 --- a/lib/App/Rgit/Repository.pm +++ b/lib/App/Rgit/Repository.pm @@ -17,11 +17,11 @@ App::Rgit::Repository - Class representing a Git repository. =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 DESCRIPTION @@ -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; @@ -129,7 +129,11 @@ sub run { ); s/\^([\^ngGwWbBR])/$escapes{$1}->()/eg for @args; } - system { $conf->git } $conf->git, @args; + { + local $ENV{GIT_DIR} = $self->repo if exists $ENV{GIT_DIR}; + local $ENV{GIT_EXEC_PATH} = $conf->git if exists $ENV{GIT_EXEC_PATH}; + system { $conf->git } $conf->git, @args; + } if ($? == -1) { warn "Failed to execute git: $!\n"; return;