listRefs
List refs
param | type [= default] | description |
---|---|---|
fs | FsClient | a file system client |
dir | string | The working tree directory path |
gitdir | string = join(dir,'.git') | The git directory path |
filepath | string | The refs path to list |
return | Promise<Array<string>> | Resolves successfully with an array of ref names below the supplied filepath |
Example Code:
let refs = await git.listRefs({ fs, dir: '/tutorial', filepath: 'refs/heads' })
console.log(refs)
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')