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

Method constructor

src/models/GitCommit.js:9–19  ·  view source on GitHub ↗
(commit)

Source from the content-addressed store, hash-verified

7
8export 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)

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected