(repo: string, commitSha: string)
| 11 | import { Repository } from '@/repository'; |
| 12 | |
| 13 | export const checkCommitExists = async (repo: string, commitSha: string) => { |
| 14 | const adapter = adapterManager.getCurrentAdapter(); |
| 15 | const dataSoruce = await adapter.resolveDataSource(); |
| 16 | try { |
| 17 | return !!(await dataSoruce.provideCommit(repo, commitSha)); |
| 18 | } catch (error) { |
| 19 | const errorMessage = |
| 20 | (error as any)?.response?.status === 404 |
| 21 | ? `No commit found for commitSha: ${commitSha}` |
| 22 | : error?.response?.data?.message; |
| 23 | vscode.window.showErrorMessage(errorMessage || `Get commit ${commitSha}} error`); |
| 24 | return false; |
| 25 | } |
| 26 | }; |
| 27 | |
| 28 | const commandSwitchToCommit = async (commitItemOrSha?: string | CommitTreeItem) => { |
| 29 | let commitSha: string | undefined = commitItemOrSha |
no test coverage detected