* 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)
| 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 |
no test coverage detected