MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / addNote

Function addNote

src/api/addNote.js:41–94  ·  view source on GitHub ↗
({
  fs: _fs,
  onSign,
  dir,
  gitdir = join(dir, '.git'),
  ref = 'refs/notes/commits',
  oid,
  note,
  force,
  author: _author,
  committer: _committer,
  signingKey,
  cache = {},
})

Source from the content-addressed store, hash-verified

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

Callers 2

test-addNote.jsFile · 0.85

Calls 6

joinFunction · 0.90
assertParameterFunction · 0.90
normalizeAuthorObjectFunction · 0.90
normalizeCommitterObjectFunction · 0.90
discoverGitdirFunction · 0.90
_addNoteFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…