({
fs: _fs,
onSign,
dir,
gitdir = join(dir, '.git'),
message,
author,
committer,
signingKey,
amend = false,
dryRun = false,
noUpdateBranch = false,
ref,
parent,
tree,
cache = {},
})
| 50 | * |
| 51 | */ |
| 52 | export async function commit({ |
| 53 | fs: _fs, |
| 54 | onSign, |
| 55 | dir, |
| 56 | gitdir = join(dir, '.git'), |
| 57 | message, |
| 58 | author, |
| 59 | committer, |
| 60 | signingKey, |
| 61 | amend = false, |
| 62 | dryRun = false, |
| 63 | noUpdateBranch = false, |
| 64 | ref, |
| 65 | parent, |
| 66 | tree, |
| 67 | cache = {}, |
| 68 | }) { |
| 69 | try { |
| 70 | assertParameter('fs', _fs) |
| 71 | if (!amend) { |
| 72 | assertParameter('message', message) |
| 73 | } |
| 74 | if (signingKey) { |
| 75 | assertParameter('onSign', onSign) |
| 76 | } |
| 77 | const fs = new FileSystem(_fs) |
| 78 | const updatedGitdir = await discoverGitdir({ fsp: fs, dotgit: gitdir }) |
| 79 | |
| 80 | return await _commit({ |
| 81 | fs, |
| 82 | cache, |
| 83 | onSign, |
| 84 | gitdir: updatedGitdir, |
| 85 | message, |
| 86 | author, |
| 87 | committer, |
| 88 | signingKey, |
| 89 | amend, |
| 90 | dryRun, |
| 91 | noUpdateBranch, |
| 92 | ref, |
| 93 | parent, |
| 94 | tree, |
| 95 | }) |
| 96 | } catch (err) { |
| 97 | err.caller = 'git.commit' |
| 98 | throw err |
| 99 | } |
| 100 | } |
no test coverage detected
searching dependent graphs…