(opts: UpdateRefWithDeps)
| 186 | } |
| 187 | |
| 188 | export async function updateRefWith(opts: UpdateRefWithDeps): Promise<void> { |
| 189 | const dir = opts.dir ?? "/"; |
| 190 | try { |
| 191 | await opts.git.writeRef({ |
| 192 | fs: opts.fs, |
| 193 | dir, |
| 194 | ref: opts.ref, |
| 195 | value: opts.value, |
| 196 | force: opts.force, |
| 197 | symbolic: opts.symbolic, |
| 198 | }); |
| 199 | } catch (cause) { |
| 200 | if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause }); |
| 201 | throw new GitError("EUPDATEREFFAIL", `git update-ref failed: ${errorMessage(cause)}`, { |
| 202 | cause, |
| 203 | }); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | // --------------------------------------------------------------- |
| 208 | // config |
no test coverage detected