]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit/Repository.pm
Specialize GIT_DIR and GIT_EXEC_PATH for each repo if they were set when calling...
[perl/modules/rgit.git] / lib / App / Rgit / Repository.pm
index 50cc9d015ff9dd6585f3499274582ed5e27be26d..f5c01b57fddcf62ea270b1639bced920284049a5 100644 (file)
@@ -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;