]> Cypherpunks.ru repositories - gostls13.git/commit
internal/testenv: use cmd.Environ in CleanCmdEnv
authorCherry Mui <cherryyz@google.com>
Fri, 27 Oct 2023 16:30:53 +0000 (12:30 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 27 Oct 2023 17:53:23 +0000 (17:53 +0000)
commit5613882df7555484680ecabc0462b7c23c6f5205
tree1d805a3a5174ed4fcbc7a455d43d34a789c5cd4e
parentb46aec07655bb5536fd9b9dbff0680de805214e8
internal/testenv: use cmd.Environ in CleanCmdEnv

In CleanCmdEnv, use cmd.Environ instead of os.Environ, so it
sets the PWD environment variable if cmd.Dir is set. This ensures
the child process sees a canonical path for its working directory.

Change-Id: Ia769552a488dc909eaf6bb7d21937adba06d1072
Reviewed-on: https://go-review.googlesource.com/c/go/+/538215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/internal/testenv/exec.go
src/internal/testenv/testenv_test.go