You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: prevent Git from showing a password prompt (#3633)
**Summary**
Fixes#764.
Turns out when fetching packages from remote sources via Git,
it may ask for a username or password and get stuck there since
we run it in the background. This patch passes the following env
variables to disable any prompts:
1. `$GIT_ASKPASS=""`
This is the command Git runs to get username and pass. Setting
it to an empty string disables it and git exits with an error.
2. `$GIT_TERMINAL_PROMPT=0`
This is new in Git 2.3 and it prevents git from even trying to
ask for a password. Surpasses `$GIT_ASKPASS` above.
3. `$GIT_SSH_COMMAND="ssh -oBatchMode=yes"`
This is also new in Git 2.3 and it makes git make the call to
ssh via this command. `BatchMode=yes` option tells ssh to not
do anything interactive (because batch/script mode) like
password prompts in case publickey auth fails etc.
**Test plan**
Do `yarn add git+https://github.com/Napsty/privrepo.git#1.0.2`. `yarn`
hangs before this patch and fails with a "Refusing to download" error
after the patch.
0 commit comments