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

Function remove

src/api/remove.js:29–53  ·  view source on GitHub ↗
({
  fs: _fs,
  dir,
  gitdir = join(dir, '.git'),
  filepath,
  cache = {},
})

Source from the content-addressed store, hash-verified

27 *
28 */
29export async function remove({
30 fs: _fs,
31 dir,
32 gitdir = join(dir, '.git'),
33 filepath,
34 cache = {},
35}) {
36 try {
37 assertParameter('fs', _fs)
38 assertParameter('gitdir', gitdir)
39 assertParameter('filepath', filepath)
40
41 const fsp = new FileSystem(_fs)
42 const updatedGitdir = await discoverGitdir({ fsp, dotgit: gitdir })
43 await GitIndexManager.acquire(
44 { fs: fsp, gitdir: updatedGitdir, cache },
45 async function (index) {
46 index.delete({ filepath })
47 }
48 )
49 } catch (err) {
50 err.caller = 'git.remove'
51 throw err
52 }
53}

Calls 5

joinFunction · 0.90
assertParameterFunction · 0.90
discoverGitdirFunction · 0.90
acquireMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…