fix(git): support secure SSH config
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
resetToCommit,
|
||||
resolveBaseRefForLog,
|
||||
revertCommit,
|
||||
setLocalIdentity,
|
||||
stageFiles,
|
||||
unstageFiles,
|
||||
applyHunk,
|
||||
@@ -129,6 +130,23 @@ describe('git index path validation', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe.runIf(canRunGit())('setLocalIdentity', () => {
|
||||
it('configures the local SSH command with the targeted simple-git opt-in', async () => {
|
||||
const { tmpDir } = await createTempRepo();
|
||||
|
||||
await setLocalIdentity(tmpDir, {
|
||||
userName: 'SSH User',
|
||||
userEmail: 'ssh@example.com',
|
||||
authType: 'ssh',
|
||||
sshKey: '/tmp/test key',
|
||||
});
|
||||
|
||||
expect(runGit(tmpDir, ['config', '--local', '--get', 'core.sshCommand']).trim()).toBe(
|
||||
"ssh -i '/tmp/test key' -o IdentitiesOnly=yes"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// applyHunk (per-hunk stage / unstage / discard)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user