MCPcopy Index your code
hub / github.com/github-tools/github / commit

Method commit

lib/Repository.js:374–393  ·  view source on GitHub ↗

* Add a commit to the repository * @see https://developer.github.com/v3/git/commits/#create-a-commit * @param {string} parent - the SHA of the parent commit * @param {string} tree - the SHA of the tree for this commit * @param {string} message - the commit message * @param {Objec

(parent, tree, message, options, cb)

Source from the content-addressed store, hash-verified

372 * @return {Promise} - the promise for the http request
373 */
374 commit(parent, tree, message, options, cb) {
375 if (typeof options === 'function') {
376 cb = options;
377 options = {};
378 }
379
380 let data = {
381 message,
382 tree,
383 parents: [parent],
384 };
385
386 data = Object.assign({}, options, data);
387
388 return this._request('POST', `/repos/${this.__fullname}/git/commits`, data, cb)
389 .then((response) => {
390 this.__currentTree.sha = response.data.sha; // Update latest commit
391 return response;
392 });
393 }
394
395 /**
396 * Update a ref

Callers 2

moveMethod · 0.95
repository.spec.jsFile · 0.80

Calls 1

_requestMethod · 0.80

Tested by

no test coverage detected