()
| 82 | }; |
| 83 | |
| 84 | export const getChangedFiles = async (): Promise<VSCodeChangedFile[]> => { |
| 85 | const routerState = await router.getState(); |
| 86 | const scheme = adapterManager.getCurrentScheme(); |
| 87 | |
| 88 | // code review page |
| 89 | if (routerState.pageType === adapterTypes.PageType.CodeReview) { |
| 90 | const repository = Repository.getInstance(scheme, routerState.repo); |
| 91 | const codeReview = await repository.getCodeReviewItem(routerState.codeReviewId); |
| 92 | return codeReview ? getCodeReviewChangedFiles(codeReview) : []; |
| 93 | } |
| 94 | // commit page |
| 95 | else if (routerState.pageType === adapterTypes.PageType.Commit) { |
| 96 | const repository = Repository.getInstance(scheme, routerState.repo); |
| 97 | const commit = await repository.getCommitItem(routerState.commitSha); |
| 98 | return commit ? getCommitChangedFiles(commit) : []; |
| 99 | } |
| 100 | return []; |
| 101 | }; |
| 102 | |
| 103 | // get the title of the diff editor |
| 104 | export const getChangedFileDiffTitle = ( |
no test coverage detected