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

Function _packObjects

src/commands/packObjects.js:25–38  ·  view source on GitHub ↗
({ fs, cache, gitdir, oids, write })

Source from the content-addressed store, hash-verified

23 * @see PackObjectsResult
24 */
25export async function _packObjects({ fs, cache, gitdir, oids, write }) {
26 const buffers = await _pack({ fs, cache, gitdir, oids })
27 const packfile = Buffer.from(await collect(buffers))
28 const packfileSha = packfile.slice(-20).toString('hex')
29 const filename = `pack-${packfileSha}.pack`
30 if (write) {
31 await fs.write(join(gitdir, `objects/pack/${filename}`), packfile)
32 return { filename }
33 }
34 return {
35 filename,
36 packfile: new Uint8Array(packfile),
37 }
38}

Callers 1

packObjectsFunction · 0.90

Calls 7

_packFunction · 0.90
collectFunction · 0.90
joinFunction · 0.90
sliceMethod · 0.80
fromMethod · 0.45
toStringMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…