mirror of
https://github.com/stablyai/orca.git
synced 2026-10-21 08:03:33 +00:00
* 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>
21 lines
547 B
TypeScript
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
|
|
}
|