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

Function currentBranch

src/api/currentBranch.js:32–54  ·  view source on GitHub ↗
({
  fs,
  dir,
  gitdir = join(dir, '.git'),
  fullname = false,
  test = false,
})

Source from the content-addressed store, hash-verified

30 *
31 */
32export async function currentBranch({
33 fs,
34 dir,
35 gitdir = join(dir, '.git'),
36 fullname = false,
37 test = false,
38}) {
39 try {
40 assertParameter('fs', fs)
41 assertParameter('gitdir', gitdir)
42 const fsp = new FileSystem(fs)
43 const updatedGitdir = await discoverGitdir({ fsp, dotgit: gitdir })
44 return await _currentBranch({
45 fs: fsp,
46 gitdir: updatedGitdir,
47 fullname,
48 test,
49 })
50 } catch (err) {
51 err.caller = 'git.currentBranch'
52 throw err
53 }
54}

Calls 4

joinFunction · 0.90
assertParameterFunction · 0.90
discoverGitdirFunction · 0.90
_currentBranchFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…