({
fs: _fs,
dir,
gitdir = join(dir, '.git'),
filepath,
cache = {},
})
| 27 | * |
| 28 | */ |
| 29 | export 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 | } |
no test coverage detected
searching dependent graphs…