refactor: update commitAndPush function to accept repoDir parameter and adjust related tests

This commit is contained in:
2026-05-13 01:46:27 +00:00
parent c758c99a28
commit cc6345c32e
4 changed files with 26 additions and 40 deletions
+1 -3
View File
@@ -47,12 +47,10 @@ export function cloneRepo(workspace, _spawnSync = spawnSync) {
});
}
export async function commitAndPush(workspace, _spawnSync = spawnSync) {
export async function commitAndPush(workspace, repoDir, _spawnSync = spawnSync) {
const run = makeRunner(_spawnSync);
try {
const repoDir = cloneRepo(workspace, _spawnSync);
await withAskpass(workspace, async credEnv => {
run(['config', 'user.email', 'ai-review[bot]@gitea'], repoDir);
run(['config', 'user.name', 'AI Review Bot'], repoDir);