(opts: StashPopWithDeps)
| 78 | } |
| 79 | |
| 80 | export async function stashPopWith(opts: StashPopWithDeps): Promise<void> { |
| 81 | const dir = opts.dir ?? "/"; |
| 82 | try { |
| 83 | await opts.git.stash({ fs: opts.fs, dir, op: "pop", refIdx: opts.index ?? 0 }); |
| 84 | } catch (cause) { |
| 85 | if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause }); |
| 86 | throw new GitError("ESTASHFAIL", `git stash pop failed: ${errorMessage(cause)}`, { cause }); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | // --------------------------------------------------------------- |
| 91 | // reset |
no test coverage detected