Files
orca/src/main/git/push-target-validation.ts
T
0ec3882cb8 Add project Windows runtime selection (#5519)
* Add project Windows runtime selection

* Fix project Windows runtime selection

Co-authored-by: Orca <help@stably.ai>

* fix: preserve WSL shell variables

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Neil <neil@stably.ai>
2026-06-17 16:08:14 -07:00

21 lines
547 B
TypeScript

import type { GitPushTarget } from '../../shared/types'
import { assertGitPushTargetShape } from '../../shared/git-push-target-validation'
import { gitExecFileAsync } from './runner'
type GitExecOptions = {
wslDistro?: string
}
export async function validateGitPushTarget(
repoPath: string,
target: unknown,
options: GitExecOptions = {}
): Promise<GitPushTarget> {
assertGitPushTargetShape(target)
await gitExecFileAsync(['check-ref-format', '--branch', target.branchName], {
cwd: repoPath,
...options
})
return target
}