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

Function resolveRef

src/api/resolveRef.js:27–52  ·  view source on GitHub ↗
({
  fs,
  dir,
  gitdir = join(dir, '.git'),
  ref,
  depth,
})

Source from the content-addressed store, hash-verified

25 *
26 */
27export async function resolveRef({
28 fs,
29 dir,
30 gitdir = join(dir, '.git'),
31 ref,
32 depth,
33}) {
34 try {
35 assertParameter('fs', fs)
36 assertParameter('gitdir', gitdir)
37 assertParameter('ref', ref)
38 const fsp = new FileSystem(fs)
39 const updatedGitdir = await discoverGitdir({ fsp, dotgit: gitdir })
40
41 const oid = await GitRefManager.resolve({
42 fs: fsp,
43 gitdir: updatedGitdir,
44 ref,
45 depth,
46 })
47 return oid
48 } catch (err) {
49 err.caller = 'git.resolveRef'
50 throw err
51 }
52}

Calls 4

joinFunction · 0.90
assertParameterFunction · 0.90
discoverGitdirFunction · 0.90
resolveMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…