Skip to content

Commit 3db4723

Browse files
kwiberggitster
authored andcommitted
Revert "git.el: Set process-environment instead of invoking env"
This reverts commit dbe4825, 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>
1 parent 06f60e8 commit 3db4723

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

contrib/emacs/git.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ and returns the process output as a string, or nil if the git failed."
232232

233233
(defun git-run-command-region (buffer start end env &rest args)
234234
"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))
237239
(git-run-process-region
238240
buffer start end "git" args)))
239241
(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."
248250
(erase-buffer)
249251
(cd dir)
250252
(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))
253256
(apply #'call-process hook-name nil (list buffer t) nil args))))
254257
(display-message-or-buffer buffer)
255258
(eq 0 status)))))

0 commit comments

Comments
 (0)