({
fs: _fs,
onSign,
dir,
gitdir = join(dir, '.git'),
ref = 'refs/notes/commits',
oid,
author: _author,
committer: _committer,
signingKey,
cache = {},
})
| 37 | */ |
| 38 | |
| 39 | export async function removeNote({ |
| 40 | fs: _fs, |
| 41 | onSign, |
| 42 | dir, |
| 43 | gitdir = join(dir, '.git'), |
| 44 | ref = 'refs/notes/commits', |
| 45 | oid, |
| 46 | author: _author, |
| 47 | committer: _committer, |
| 48 | signingKey, |
| 49 | cache = {}, |
| 50 | }) { |
| 51 | try { |
| 52 | assertParameter('fs', _fs) |
| 53 | assertParameter('gitdir', gitdir) |
| 54 | assertParameter('oid', oid) |
| 55 | |
| 56 | const fs = new FileSystem(_fs) |
| 57 | const updatedGitdir = await discoverGitdir({ fsp: fs, dotgit: gitdir }) |
| 58 | |
| 59 | const author = await normalizeAuthorObject({ |
| 60 | fs, |
| 61 | gitdir: updatedGitdir, |
| 62 | author: _author, |
| 63 | }) |
| 64 | if (!author) throw new MissingNameError('author') |
| 65 | |
| 66 | const committer = await normalizeCommitterObject({ |
| 67 | fs, |
| 68 | gitdir: updatedGitdir, |
| 69 | author, |
| 70 | committer: _committer, |
| 71 | }) |
| 72 | if (!committer) throw new MissingNameError('committer') |
| 73 | |
| 74 | return await _removeNote({ |
| 75 | fs, |
| 76 | cache, |
| 77 | onSign, |
| 78 | gitdir: updatedGitdir, |
| 79 | ref, |
| 80 | oid, |
| 81 | author, |
| 82 | committer, |
| 83 | signingKey, |
| 84 | }) |
| 85 | } catch (err) { |
| 86 | err.caller = 'git.removeNote' |
| 87 | throw err |
| 88 | } |
| 89 | } |
no test coverage detected
searching dependent graphs…