Git - tweak git blame computation (#234386)

* Helper methods

* Finished implementing the prototype

* Command handled model creation/disposal

* Cache staged resources diff information
This commit is contained in:
Ladislau Szomoru
2024-11-21 23:18:49 +01:00
committed by GitHub
parent f2fba1b45d
commit 927f53de44
4 changed files with 120 additions and 75 deletions

View File

@@ -2207,9 +2207,16 @@ export class Repository {
}
}
async blame2(path: string): Promise<BlameInformation[] | undefined> {
async blame2(path: string, ref?: string): Promise<BlameInformation[] | undefined> {
try {
const args = ['blame', '--root', '--incremental', '--', sanitizePath(path)];
const args = ['blame', '--root', '--incremental'];
if (ref) {
args.push(ref);
}
args.push('--', sanitizePath(path));
const result = await this.exec(args);
return parseGitBlame(result.stdout.trim());