fix(git): support secure SSH config

This commit is contained in:
Bohdan Triapitsyn
2026-08-02 23:02:14 +03:00
parent 8ebf711f93
commit 134d055ee6
6 changed files with 42 additions and 15 deletions
@@ -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)
// ---------------------------------------------------------------------------