Revert "git.el: Set process-environment instead of invoking env"
This reverts commit dbe48256b41c1e94d81f2458d7e84b1fdcb47026, which caused mis-encoding of non-ASCII author/committer names when the git-status mode is used to create commits. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karl Hasselström committed
Jun 3, 2008 at 00:41 UTC
3db4723ead0f141540118f622dedac5106b07a8e
1 file changed
+7
-4
contrib/emacs/git.el
+7
-4
@@ -232,8 +232,10 @@ and returns the process output as a string, or nil if the git failed."
232
233
(defun git-run-command-region (buffer start end env &rest args)
234
"Run a git command with specified buffer region as input."
235
- (unless (eq 0 (let ((process-environment (append (git-get-env-strings env)
236
- process-environment)))
235
+ (unless (eq 0 (if env
236
+ (git-run-process-region
237
+ buffer start end "env"
238
+ (append (git-get-env-strings env) (list "git") args))
239
(git-run-process-region
240
buffer start end "git" args)))
241
(error "Failed to run \"git %s\":\n%s" (mapconcat (lambda (x) x) args " ") (buffer-string))))
@@ -248,8 +250,9 @@ and returns the process output as a string, or nil if the git failed."
250
(erase-buffer)
251
(cd dir)
252
(setq status
251
- (let ((process-environment (append (git-get-env-strings env)
252
- process-environment)))
253
+ (if env
254
+ (apply #'call-process "env" nil (list buffer t) nil
255
+ (append (git-get-env-strings env) (list hook-name) args))
256
(apply #'call-process hook-name nil (list buffer t) nil args))))
257
(display-message-or-buffer buffer)
258
(eq 0 status)))))