({ prefix, symrefs, peelTags })
| 9 | * @returns {Uint8Array[]} |
| 10 | */ |
| 11 | export async function writeListRefsRequest({ prefix, symrefs, peelTags }) { |
| 12 | const packstream = [] |
| 13 | // command |
| 14 | packstream.push(GitPktLine.encode('command=ls-refs\n')) |
| 15 | // capability-list |
| 16 | packstream.push(GitPktLine.encode(`agent=${pkg.agent}\n`)) |
| 17 | // [command-args] |
| 18 | if (peelTags || symrefs || prefix) { |
| 19 | packstream.push(GitPktLine.delim()) |
| 20 | } |
| 21 | if (peelTags) packstream.push(GitPktLine.encode('peel')) |
| 22 | if (symrefs) packstream.push(GitPktLine.encode('symrefs')) |
| 23 | if (prefix) packstream.push(GitPktLine.encode(`ref-prefix ${prefix}`)) |
| 24 | packstream.push(GitPktLine.flush()) |
| 25 | return packstream |
| 26 | } |
no test coverage detected
searching dependent graphs…