Subject: Re: bug#23769: 25.0.95; Mode Line breakage in vc-git

From: [email-masked] (Phillip Lord)
Date: Fri, 17 Jun 2016 16:09:53 +0100

Dmitry Gutov <[email-masked]> writes:

> On 06/17/2016 09:54 AM, Eli Zaretskii wrote:
>
>> (setenv "FOO") works for me.
>
> setenv works destructively. To use it and remain good citizens, we'd have to
> `(copy-sequence process-environment)` every time we call a Git command.
>
> Maybe that's not huge in the grand scheme of things, but it certainly looks
> wasteful.

I used this in my tests....

(let ((foo (getenv "FOO")))
  (unwind-protect
      (progn    
        (setenv "FOO")
        (apply 'git-program args))
    (setenv "FOO" foo)))

It's why I that setting and unsetting GIT_DIR seemed a bit of a pain
earlier. It should work though.

Phil