expandOid
Expand and resolve a short oid into a full oid
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 |
oid | string | The shortened oid prefix to expand (like "0414d2a") |
cache | object | a cache object |
return | Promise<string> | Resolves successfully with the full oid (like "0414d2a286d7bbc7a4a326a61c1f9f888a8ab87f") |
Example Code:
let oid = await git.expandOid({ fs, dir: '/tutorial', oid: '0414d2a'})
console.log(oid)
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')