* Resolve a ref that may carry a revision suffix (`HEAD^`, * `HEAD~2`, ...) to a concrete oid via `rev-parse`, which owns * the suffix-walking logic. A plain ref is returned untouched so * the downstream method keeps resolving branch / tag names * itself. Used by subcommands whose typed methods
( client: GitClient, dir: string, ref: string | undefined, )
| 2352 | * grammar. |
| 2353 | */ |
| 2354 | async function resolveRevisionRef( |
| 2355 | client: GitClient, |
| 2356 | dir: string, |
| 2357 | ref: string | undefined, |
| 2358 | ): Promise<string | undefined> { |
| 2359 | if (ref === undefined || !hasRevisionSuffix(ref)) return ref; |
| 2360 | return client.revParse({ dir, ref }); |
| 2361 | } |
| 2362 | |
| 2363 | function isSupportedRemoteUrl(url: string): boolean { |
| 2364 | return url.startsWith("https://") || url.startsWith("http://") || url.startsWith("file://"); |