Git - use relative path in getObjectDetails() (#240783)

* Git - use relative path in `getObjectDetails()`

* 💄
This commit is contained in:
Ladislau Szomoru
2025-02-14 12:58:04 +01:00
committed by GitHub
parent 507a4240e3
commit db0b398727

View File

@@ -2017,7 +2017,10 @@ export class Repository implements Disposable {
}
getObjectDetails(ref: string, filePath: string): Promise<{ mode: string; object: string; size: number }> {
return this.run(Operation.GetObjectDetails, () => this.repository.getObjectDetails(ref, filePath));
return this.run(Operation.GetObjectDetails, () => {
const path = relativePath(this.repository.root, filePath).replace(/\\/g, '/');
return this.repository.getObjectDetails(ref, path);
});
}
detectObjectType(object: string): Promise<{ mimetype: string; encoding?: string }> {