git.el: Set process-environment instead of invoking env
This will make it a little less posix-dependent, and more efficient. Included is also a minor doc improvement. Signed-off-by: David Kågedal <davidk@lysator.liu.se> Acked-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Kågedal committed
Feb 19, 2008 at 15:01 UTC
f27e55864317611385be4d33b3c53ca787379df9
1 file changed
+3
-4
contrib/emacs/git.el
+3
-4
@@ -185,9 +185,8 @@ if there is already one that displays the same directory."
185
186
(defun git-call-process-env (buffer env &rest args)
187
"Wrapper for call-process that sets environment strings."
188
- (if env
189
- (apply #'call-process "env" nil buffer nil
190
- (append (git-get-env-strings env) (list "git") args))
188
+ (let ((process-environment (append (git-get-env-strings env)
189
+ process-environment)))
190
(apply #'call-process "git" nil buffer nil args)))
191
192
(defun git-call-process-display-error (&rest args)
@@ -204,7 +203,7 @@ if there is already one that displays the same directory."
203
204
(defun git-call-process-env-string (env &rest args)
205
"Wrapper for call-process that sets environment strings,
207
-and returns the process output as a string."
206
+and returns the process output as a string, or nil if the git failed."
207
(with-temp-buffer
208
(and (eq 0 (apply #' git-call-process-env t env args))
209
(buffer-string))))