Repository navigation
Conversation
The env property supplied to the simpleGit() builder was silently ignored, so the workaround from steveukx#1189 of passing GIT_SSH_COMMAND through the constructor stopped working without any error or typings to flag it. The constructor env is now used as the initial executor environment, using the same interface as calling .env({...}) on the instance - guarded keys supplied this way reject the tasks they are used with unless named in allowEnvironment, matching the .env() behaviour.
🦋 Changeset detectedLatest commit: 0d6b054 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Owner
|
Thank you for creating the pull request. I've added a note to the issue to explain why the code sample wasn't working - the change relates to how the |
Author
|
Yes thank you a lot! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1189
Note
LLM-generated contribution: this pull request (code, tests, changeset and description) has been generated by a LLM.
Problem
As reported in #1189, supplying
GIT_SSH_COMMAND(or any other variable) through theenvproperty of thesimpleGit()builder options worked in v3 but is silently ignored in v4 - theGitconstructor only readsbaseDir,maxConcurrentProcessesandtrimmed, andenvis not part of the publishedSimpleGitOptionstypings. Users migrating from v3 get no error and no typings hint that the constructor approach stopped working.Change
envsupplied to thesimpleGit()builder is now used as the initial executor environment, using the same interface as calling.env({...})on the created instance (single-key.env(name, value)calls merge into it, an object argument replaces it entirely).envis added to theSimpleGitOptionstypings.GIT_-prefixed key plus known-vulnerable keys such asEDITOR/PAGER) supplied through the constructor reject the tasks they are used with unless named inallowEnvironment, matching the existing.env()behaviour described in the v4 release notes.Tests
envreaching the spawned process, guarded-key rejection withoutallowEnvironment, theGIT_SSH_COMMANDscenario from Bug: git.env('GIT_SSH_COMMAND', ...) is ignored, while constructor env works #1189, and the merge/replace interaction between constructorenvand.env().gitprocess proving an allow-listed constructorenvvariable is honoured (commit author) and that unlisted guarded keys reject the task.