Function resolveRef

  • Get the value of a symbolic ref or resolve a ref to its SHA-1 object id.

    Returns

    Resolves successfully with a SHA-1 object id or the value of a symbolic ref.

    Example

    const currentCommit = await resolveRef({ fs, dir: '/tutorial', ref: 'HEAD' })
    console.log(currentCommit)
    const currentBranch = await resolveRef({ fs, dir: '/tutorial', ref: 'HEAD', depth: 2 })
    console.log(currentBranch)

    Parameters

    Returns Promise<string>

Generated using TypeDoc