Replaced magit-log-edit-setup-author-env with magit-log-edit-author-env.
---
 magit.el |   28 ++++++++++------------------
 1 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/magit.el b/magit.el
index 8bf1b8d..a5b5fb2 100644
--- a/magit.el
+++ b/magit.el
@@ -3058,22 +3058,14 @@ Prefix arg means justify as well."
 (defun magit-log-edit-get-field (name)
   (cdr (assq name (magit-log-edit-get-fields))))
 
-(defun magit-log-edit-setup-author-env (author)
-  (cond (author
-        ;; XXX - this is a bit strict, probably.
-        (or (string-match "\\(.*\\) <\\(.*\\)>, \\(.*\\)" author)
-            (error "Can't parse author string"))
-        ;; Shucks, setenv destroys the match data.
-        (let ((name (match-string 1 author))
-              (email (match-string 2 author))
-              (date  (match-string 3 author)))
-          (setenv "GIT_AUTHOR_NAME" name)
-          (setenv "GIT_AUTHOR_EMAIL" email)
-          (setenv "GIT_AUTHOR_DATE" date)))
-       (t
-        (setenv "GIT_AUTHOR_NAME")
-        (setenv "GIT_AUTHOR_EMAIL")
-        (setenv "GIT_AUTHOR_DATE"))))
+(defun magit-log-edit-author-env (author)
+  (when author
+    ;; XXX - this is a bit strict, probably.
+    (unless (string-match "\\(.*\\) <\\(.*\\)>, \\(.*\\)" author)
+      (error "Can't parse author string"))
+    (list (concat "GIT_AUTHOR_NAME=" (match-string 1 author))
+         (concat "GIT_AUTHOR_EMAIL=" (match-string 2 author))
+         (concat "GIT_AUTHOR_DATE=" (match-string 3 author)))))
 
 (defun magit-log-edit-push-to-comment-ring (comment)
   (when (or (ring-empty-p log-edit-comment-ring)
@@ -3092,9 +3084,9 @@ Prefix arg means justify as well."
                       (equal (cdr sign-off-field) "yes")
                     magit-commit-signoff))
         (tag (cdr (assq 'tag fields)))
-        (author (cdr (assq 'author fields))))
+        (author (cdr (assq 'author fields)))
+        (magit-env (append (magit-log-edit-author-env author) magit-env)))
     (magit-log-edit-push-to-comment-ring (buffer-string))
-    (magit-log-edit-setup-author-env author)
     (magit-log-edit-set-fields nil)
     (magit-log-edit-cleanup)
     (if (= (buffer-size) 0)
-- 
1.6.3.3

Reply via email to