MCPcopy Index your code
hub / github.com/isomorphic-git/isomorphic-git / init

Function init

src/api/init.js:26–53  ·  view source on GitHub ↗
({
  fs,
  bare = false,
  dir,
  gitdir = bare ? dir : join(dir, '.git'),
  defaultBranch = 'master',
})

Source from the content-addressed store, hash-verified

24 *
25 */
26export async function init({
27 fs,
28 bare = false,
29 dir,
30 gitdir = bare ? dir : join(dir, '.git'),
31 defaultBranch = 'master',
32}) {
33 try {
34 assertParameter('fs', fs)
35 assertParameter('gitdir', gitdir)
36 if (!bare) {
37 assertParameter('dir', dir)
38 }
39
40 const fsp = new FileSystem(fs)
41 const updatedGitdir = await discoverGitdir({ fsp, dotgit: gitdir })
42 return await _init({
43 fs: fsp,
44 bare,
45 dir,
46 gitdir: updatedGitdir,
47 defaultBranch,
48 })
49 } catch (err) {
50 err.caller = 'git.init'
51 throw err
52 }
53}

Calls 4

joinFunction · 0.90
assertParameterFunction · 0.90
discoverGitdirFunction · 0.90
_initFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…