Git - add extension API to get a patch for a commit range (#286159)

* Git - add extension API to get a patch for a commit range

* Turns out `git diff` does not support the `--root` flag
This commit is contained in:
Ladislau Szomoru
2026-01-06 15:18:53 +00:00
committed by GitHub
parent 67c15fe860
commit d0576dab05
4 changed files with 21 additions and 0 deletions

View File

@@ -200,6 +200,10 @@ export class ApiRepository implements Repository {
return this.#repository.diffBetween(ref1, ref2, path);
}
diffBetweenPatch(ref1: string, ref2: string, path?: string): Promise<string> {
return this.#repository.diffBetweenPatch(ref1, ref2, path);
}
diffBetweenWithStats(ref1: string, ref2: string, path?: string): Promise<DiffChange[]> {
return this.#repository.diffBetweenWithStats(ref1, ref2, path);
}

View File

@@ -261,6 +261,7 @@ export interface Repository {
diffBlobs(object1: string, object2: string): Promise<string>;
diffBetween(ref1: string, ref2: string): Promise<Change[]>;
diffBetween(ref1: string, ref2: string, path: string): Promise<string>;
diffBetweenPatch(ref1: string, ref2: string, path?: string): Promise<string>;
diffBetweenWithStats(ref1: string, ref2: string, path?: string): Promise<DiffChange[]>;
hashObject(data: string): Promise<string>;