fix(commit): Fixed issue with retrieving uncommitted diffs in git repository

This commit is contained in:
2024-06-23 23:20:01 +02:00
parent e355c51c8d
commit 3f451cfcb1
3 changed files with 10 additions and 3 deletions

View File

@ -27,7 +27,7 @@ export class Commit {
smartgitInstance,
this.projectDir
);
const diffString = await gitRepo.getUncommittedDiff();
const diffStringArray = await gitRepo.getUncommittedDiff(['pnpm-lock.json']);
const projectContext = new ProjectContext(this.projectDir);
let contextString = await projectContext.update();
contextString = `
@ -35,7 +35,7 @@ ${contextString}
Below is the diff of the uncommitted changes. If nothing is changed, there are no changes:
${diffString || 'No changes.'}
${diffStringArray[0] ? diffStringArray.join('\n\n') : 'No changes.'}
`;
let result = await this.aiDocsRef.openaiInstance.chat({