Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace StrictHostKeyChecking=accept-new with BatchMode=yes #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
klassiker wants to merge 1 commit into npm:main
base: main
Choose a base branch
Loading
from klassiker:main
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/opts.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ const askPassSetInEnv = process.env.GIT_ASKPASS !== undefined
const { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs()

// Values we want to set if they're not already defined by the end user
// This defaults to accepting new ssh host key fingerprints
// This defaults to disabling user interaction with BatchMode
const finalGitEnv = {
...(askPassSetInEnv || askPassSetInConfig ? {} : {
GIT_ASKPASS: 'echo',
}),
...(sshCommandSetInEnv || sshCommandSetInConfig ? {} : {
GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new',
GIT_SSH_COMMAND: 'ssh -o BatchMode=yes',
}),
}

Expand Down
6 changes: 3 additions & 3 deletions test/opts.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ t.test('defaults', t => {
t.match(gitOpts(), {
env: {
GIT_ASKPASS: 'echo',
GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new',
GIT_SSH_COMMAND: 'ssh -o BatchMode=yes',
},
shell: false,
}, 'got the git defaults we want')
Expand All @@ -45,7 +45,7 @@ t.test('handle case when fs.existsSync throws an error', t => {
t.match(gitOptsWithMockFs(), {
env: {
GIT_ASKPASS: 'echo',
GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new',
GIT_SSH_COMMAND: 'ssh -o BatchMode=yes',
},
shell: false,
}, 'should apply defaults when fs.existsSync throws an error')
Expand All @@ -64,7 +64,7 @@ t.test('handle case when git config does not exist', t => {
t.match(gitOptsWithMockFs(), {
env: {
GIT_ASKPASS: 'echo',
GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new',
GIT_SSH_COMMAND: 'ssh -o BatchMode=yes',
},
shell: false,
}, 'should apply defaults when git config does not exist')
Expand Down

AltStyle によって変換されたページ (->オリジナル) /