-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: prevent Git from showing a password prompt
**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.
- Loading branch information
Burak Yigit Kaya
committed
Jun 14, 2017
1 parent
0361edf
commit 2f2673b
Showing
1 changed file
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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