(path: string, sha: string | null | undefined)
| 339 | } |
| 340 | |
| 341 | async readFileMetadata(path: string, sha: string | null | undefined) { |
| 342 | const fetchFileMetadata = async () => { |
| 343 | try { |
| 344 | const result: ReposListCommitsResponse = await this.request( |
| 345 | `${this.originRepoURL}/commits`, |
| 346 | { |
| 347 | params: { path, sha: this.branch, stat: 'false' }, |
| 348 | }, |
| 349 | ); |
| 350 | const { commit } = result[0]; |
| 351 | return { |
| 352 | author: commit.author.name || commit.author.email, |
| 353 | updatedOn: commit.author.date, |
| 354 | }; |
| 355 | } catch (e) { |
| 356 | return { author: '', updatedOn: '' }; |
| 357 | } |
| 358 | }; |
| 359 | const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage); |
| 360 | return fileMetadata; |
| 361 | } |
| 362 | |
| 363 | async fetchBlobContent({ sha, repoURL, parseText }: BlobArgs) { |
| 364 | const result: GitGetBlobResponse = await this.request(`${repoURL}/git/blobs/${sha}`, { |
nothing calls this directly
no test coverage detected