SCM - add the capability to attach a history item as chat context (#249073)

* Saving my work

* Got the variable widget working

* Refactored the variable widget

* Clean up the attachment widget

* Content provider stub

* Add proposed API for chat context

* Add method to get the complete details of a commit
This commit is contained in:
Ladislau Szomoru
2025-05-16 08:09:12 +00:00
committed by GitHub
parent 7052ebfea0
commit daab3ffa1e
17 changed files with 274 additions and 34 deletions

View File

@@ -2927,6 +2927,19 @@ export class Repository {
return commits[0];
}
async showCommit(ref: string): Promise<string> {
try {
const result = await this.exec(['show', ref]);
return result.stdout.trim();
} catch (err) {
if (/^fatal: bad revision '.+'/.test(err.stderr || '')) {
err.gitErrorCode = GitErrorCodes.BadRevision;
}
throw err;
}
}
async revList(ref1: string, ref2: string): Promise<string[]> {
const result = await this.exec(['rev-list', `${ref1}..${ref2}`]);
if (result.stderr) {