(opts: StashPushWithDeps)
| 41 | } |
| 42 | |
| 43 | export async function stashPushWith(opts: StashPushWithDeps): Promise<void> { |
| 44 | const dir = opts.dir ?? "/"; |
| 45 | try { |
| 46 | await opts.git.stash({ fs: opts.fs, dir, op: "push", message: opts.message }); |
| 47 | } catch (cause) { |
| 48 | if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause }); |
| 49 | throw new GitError("ESTASHFAIL", `git stash push failed: ${errorMessage(cause)}`, { cause }); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | export interface StashListWithDeps extends BaseWorktreeOptions { |
| 54 | git: IsomorphicGitStashClient; |
no test coverage detected