async function packObjects({
  fs,
  dir,
  gitdir = join(dir, '.git'),
  oids,
  write = false,
  cache = {},
}) {
  try {
    assertParameter('fs', fs)
    assertParameter('gitdir', gitdir)
    assertParameter('oids', oids)

    return await _packObjects({
      fs: new FileSystem(fs),
      cache,
      gitdir,
      oids,
      write,
    })
  } catch (err) {
    err.caller = 'git.packObjects'
    throw err
  }
}
Create a packfile from an array of SHA-1 object ids

@param {object} args
@param {FsClient} args.fs - a file system client
@param {string} [args.dir] - The [working tree](dir-vs-gitdir.md) directory path
@param {string} [args.gitdir=join(dir, '.git')] - [required] The [git directory](dir-vs-gitdir.md) path
@param {string[]} args.oids - An array of SHA-1 object ids to be included in the packfile
@param {boolean} [args.write = false] - Whether to save the packfile to disk or not
@param {object} [args.cache] - a [cache](cache.md) object

@returns {Promise<PackObjectsResult>} Resolves successfully when the packfile is ready with the filename and buffer
@see PackObjectsResult

@example
// Create a packfile containing only an empty tree
let { packfile } = await git.packObjects({
  fs,
  dir: '/tutorial',
  oids: ['4b825dc642cb6eb9a060e54bf8d69288fbee4904']
})
console.log(packfile)