(commit)
| 7 | |
| 8 | export class GitCommit { |
| 9 | constructor(commit) { |
| 10 | if (typeof commit === 'string') { |
| 11 | this._commit = commit |
| 12 | } else if (Buffer.isBuffer(commit)) { |
| 13 | this._commit = commit.toString('utf8') |
| 14 | } else if (typeof commit === 'object') { |
| 15 | this._commit = GitCommit.render(commit) |
| 16 | } else { |
| 17 | throw new InternalError('invalid type passed to GitCommit constructor') |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | static fromPayloadSignature({ payload, signature }) { |
| 22 | const headers = GitCommit.justHeaders(payload) |