Commit 0796f06c authored by Noam Postavsky's avatar Noam Postavsky Committed by Jonas Bernoulli

Replace setenv with push on process-environment

Let-binding process-environment does not nessarily protect from changes
made by setenv, because setenv may destructively modify the list object.
parent 08c61ea8
......@@ -166,7 +166,7 @@ to inverse the meaning of the prefix argument. \n(git commit
(when (setq args (magit-commit-assert args (not override-date)))
(let ((process-environment process-environment))
(unless override-date
(setenv "GIT_COMMITTER_DATE" (magit-rev-format "%cD")))
(push (magit-rev-format "GIT_COMMITTER_DATE=%cD") process-environment))
(magit-run-git-with-editor "commit" "--amend" "--no-edit" args))))
;;;###autoload
......@@ -186,7 +186,7 @@ and ignore the option.
magit-commit-reword-override-date)))
(let ((process-environment process-environment))
(unless override-date
(setenv "GIT_COMMITTER_DATE" (magit-rev-format "%cD")))
(push (magit-rev-format "GIT_COMMITTER_DATE=%cD") process-environment))
(magit-run-git-with-editor "commit" "--amend" "--only" args)))
;;;###autoload
......
......@@ -1139,11 +1139,12 @@ Return a list of two integers: (A>B B>A)."
(error "Cannot read tree %s" it)))
(if (file-remote-p default-directory)
(let ((magit-tramp-process-environment
(setenv-internal magit-tramp-process-environment
"GIT_INDEX_FILE" ,file t)))
(cons (concat "GIT_INDEX_FILE=" ,file)
magit-tramp-process-environment)))
,@body)
(let ((process-environment process-environment))
(setenv "GIT_INDEX_FILE" ,file)
(let ((process-environment
(cons (concat "GIT_INDEX_FILE=" ,file)
process-environment)))
,@body)))
(ignore-errors
(delete-file (concat (file-remote-p default-directory) ,file)))))))
......
......@@ -400,7 +400,7 @@ START has to be selected from a list of recent commits."
(if commit
(let ((process-environment process-environment))
(when editor
(setenv "GIT_SEQUENCE_EDITOR" editor))
(push (concat "GIT_SEQUENCE_EDITOR=" editor) process-environment))
(magit-run-git-sequencer "rebase" "-i" args
(unless (member "--root" args) commit)))
(magit-log-select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment