(url: string)
| 273 | } |
| 274 | |
| 275 | export const isUrlAValidGitRepo = async (url: string) => { |
| 276 | const git = simpleGit(); |
| 277 | |
| 278 | // List the remote heads. If an exception is thrown, the URL is not a valid git repo. |
| 279 | try { |
| 280 | const result = await git.listRemote(['--heads', url]); |
| 281 | return result.trim().length > 0; |
| 282 | } catch (error: unknown) { |
| 283 | return false; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | export const getOriginUrl = async (path: string) => { |
| 288 | const git = createGitClientForPath(path); |
no outgoing calls
no test coverage detected