mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user