feat: phase 3 for git integration

This commit is contained in:
2026-02-16 11:46:47 +01:00
parent 4c437cbea2
commit 9d71aa63fb
18 changed files with 499 additions and 7 deletions

View File

@@ -36,6 +36,11 @@ export interface GitStatusDto {
counts: GitStatusCounts;
}
export interface GitDiffDto {
filePath: string;
patch: string;
}
export type GitInitPhase =
| 'checking-git'
| 'initializing-repo'
@@ -217,6 +222,16 @@ export class GitEngine {
};
}
async getDiff(projectPath: string, filePath: string): Promise<GitDiffDto> {
const git = simpleGit(projectPath);
const patch = await git.diff(['--', filePath]);
return {
filePath,
patch,
};
}
async ensureGitignore(projectPath: string): Promise<GitIgnoreEnsureResult> {
const gitignorePath = path.join(projectPath, '.gitignore');