( branch: string, cwd: string )
| 35 | }; |
| 36 | |
| 37 | export const switchToMaybeExistingBranch = async ( |
| 38 | branch: string, |
| 39 | cwd: string |
| 40 | ) => { |
| 41 | let { stderr } = await execWithOutput("git", ["checkout", branch], { |
| 42 | ignoreReturnCode: true, |
| 43 | cwd, |
| 44 | }); |
| 45 | let isCreatingBranch = !stderr |
| 46 | .toString() |
| 47 | .includes(`Switched to a new branch '${branch}'`); |
| 48 | if (isCreatingBranch) { |
| 49 | await execWithOutput("git", ["checkout", "-b", branch], { cwd }); |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | export const reset = async ( |
| 54 | pathSpec: string, |
nothing calls this directly
no test coverage detected