Skip to content

Commit

Permalink
fix: do not use a shell for git commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf committed Apr 14, 2021
1 parent 35f321c commit 766bfbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/opts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ const gitEnv = {
module.exports = (opts = {}) => ({
stdioString: true,
...opts,
shell: false,
env: opts.env || { ...gitEnv, ...process.env }
})
3 changes: 3 additions & 0 deletions test/opts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const gitEnv = {

t.match(gitOpts().env, gitEnv, 'got the git defaults we want')

t.equal(gitOpts().shell, false, 'shell defaults to false')
t.equal(gitOpts({ shell: '/bin/bash' }).shell, false, 'shell cannot be overridden')

t.test('does not override', t => {
const { GIT_ASKPASS, GIT_SSH_COMMAND } = process.env
t.teardown(() => {
Expand Down

0 comments on commit 766bfbe

Please sign in to comment.