(path: string, sha: string | null | undefined)
| 289 | } |
| 290 | |
| 291 | async readFileMetadata(path: string, sha: string | null | undefined) { |
| 292 | const fetchFileMetadata = async () => { |
| 293 | try { |
| 294 | const result: ReposListCommitsResponse = await this.request( |
| 295 | `${this.originRepoURL}/commits`, |
| 296 | { |
| 297 | params: { path, sha: this.branch, stat: 'false' }, |
| 298 | }, |
| 299 | ); |
| 300 | const { commit } = result[0]; |
| 301 | return { |
| 302 | author: commit.author.name || commit.author.email, |
| 303 | updatedOn: commit.author.date, |
| 304 | }; |
| 305 | } catch (e) { |
| 306 | return { author: '', updatedOn: '' }; |
| 307 | } |
| 308 | }; |
| 309 | const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage); |
| 310 | return fileMetadata; |
| 311 | } |
| 312 | |
| 313 | async fetchBlobContent({ sha, repoURL, parseText }: BlobArgs) { |
| 314 | const result: GitGetBlobResponse = await this.request(`${repoURL}/git/blobs/${sha}`, { |
nothing calls this directly
no test coverage detected