From: Vincent Pit Date: Tue, 7 Oct 2008 20:44:10 +0000 (+0200) Subject: Specialize GIT_DIR and GIT_EXEC_PATH for each repo if they were set when calling... X-Git-Tag: v0.04~4 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=commitdiff_plain;h=9b875b472233edfa0e284c46fc6465005a1df8e3 Specialize GIT_DIR and GIT_EXEC_PATH for each repo if they were set when calling rgit. Fixes GIT_DIR not working --- diff --git a/lib/App/Rgit/Repository.pm b/lib/App/Rgit/Repository.pm index 50cc9d0..f5c01b5 100644 --- a/lib/App/Rgit/Repository.pm +++ b/lib/App/Rgit/Repository.pm @@ -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;