( refs: GitRefs, api: ProviderAPIClient, options: Options | undefined, git: SimpleGit, )
| 86 | }; |
| 87 | |
| 88 | export async function createRunEnv( |
| 89 | refs: GitRefs, |
| 90 | api: ProviderAPIClient, |
| 91 | options: Options | undefined, |
| 92 | git: SimpleGit, |
| 93 | ): Promise<RunEnv> { |
| 94 | const [head, base] = await Promise.all([ |
| 95 | normalizeGitRef(refs.head, git), |
| 96 | refs.base && normalizeGitRef(refs.base, git), |
| 97 | ]); |
| 98 | |
| 99 | return { |
| 100 | refs: { head, ...(base && { base }) }, |
| 101 | api, |
| 102 | settings: { |
| 103 | ...DEFAULT_SETTINGS, |
| 104 | ...(options && sanitizeOptions(options)), |
| 105 | }, |
| 106 | git, |
| 107 | }; |
| 108 | } |
| 109 | |
| 110 | function sanitizeOptions(options: Options): Options { |
| 111 | return removeUndefinedAndEmptyProps({ |
no test coverage detected