(data: Uint8Array)
| 552 | } |
| 553 | |
| 554 | function parseCommit(data: Uint8Array): { tree: string } { |
| 555 | const text = td.decode(data); |
| 556 | const m = text.match(/^tree ([0-9a-f]{40})/m); |
| 557 | if (!m) throw new PackParseError("commit has no tree"); |
| 558 | return { tree: m[1] }; |
| 559 | } |
| 560 | |
| 561 | // Parse a tree object: entries of "mode<space>name\0<20-byte sha>" |
| 562 | function parseTree(data: Uint8Array): { mode: string; name: string; sha: string }[] { |