(fileUri: vscode.Uri)
| 69 | // get the file uri with the concrete commit sha, the `ref` in |
| 70 | // `fileUri.authority` maybe newer but not related this file |
| 71 | const getConcreteFileUri = async (fileUri: vscode.Uri) => { |
| 72 | // the `fileUri.authority` maybe empty, fallback to router.getAuthority() in this case |
| 73 | const fileAuthority = fileUri.authority || (await router.getAuthority()); |
| 74 | const [repo, ref] = fileAuthority.split('+').filter(Boolean); |
| 75 | const repository = Repository.getInstance(fileUri.scheme, repo); |
| 76 | const commit = await repository.getFileLatestCommit(ref, fileUri.path.slice(1)); |
| 77 | const latestCommitSha = commit?.sha || (await repository.getCommitItem(ref))?.sha || 'HEAD'; |
| 78 | |
| 79 | return fileUri.with({ authority: `${repo}+${latestCommitSha}` }); |
| 80 | }; |
| 81 | |
| 82 | // show the file's diff between current commit and previous commit |
| 83 | const commandOpenFilePreviousRevision = async (fileUri: vscode.Uri) => { |
no test coverage detected