expandRef
Expand an abbreviated ref to its full name
param | type [= default] | description |
---|---|---|
fs | FsClient | a file system implementation |
dir | string | The working tree directory path |
gitdir | string = join(dir,'.git') | The git directory path |
ref | string | The ref to expand (like "v1.0.0") |
return | Promise<string> | Resolves successfully with a full ref name ("refs/tags/v1.0.0") |
Example Code:
let fullRef = await git.expandRef({ fs, dir: '/tutorial', ref: 'main'})
console.log(fullRef)
Tip: If you need a clean slate, expand and run this snippet to clean up the file system.
window.fs = new LightningFS('fs', { wipe: true })
window.pfs = window.fs.promises
console.log('done')