---
 magit.el |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/magit.el b/magit.el
index 637046e..6712ab4 100644
--- a/magit.el
+++ b/magit.el
@@ -1219,6 +1219,8 @@ FUNC should leave point at the end of the modified region"
 (defvar magit-process-client-buffer nil)
 (defvar magit-process-buffer-name "*magit-process*"
   "Buffer name for running git commands")
+(defvar magit-env nil
+  "Environment for running magit commands.")
 
 (defun magit-run* (cmd-and-args
                   &optional logline noerase noerror nowait input)
@@ -1247,8 +1249,13 @@ FUNC should leave point at the end of the modified 
region"
        (if noerase
            (goto-char (point-max))
          (erase-buffer))
-       (insert "$ " (or logline
-                        (magit-concat-with-delim " " cmd-and-args))
+       (if magit-env
+           (setq cmd-and-args (append magit-env cmd-and-args)
+                 cmd "/usr/bin/env"
+                 args cmd-and-args))
+       (insert "$ "
+               (or logline
+                   (magit-concat-with-delim " " cmd-and-args))
                "\n")
        (cond (nowait
               (setq magit-process
-- 
1.6.3.3

Reply via email to