* Delete a file from a branch * @see https://developer.github.com/v3/repos/contents/#delete-a-file * @param {string} branch - the branch to delete from, or the default branch if not specified * @param {string} path - the path of the file to remove * @param {Requestable.callback} cb -
(branch, path, cb)
| 711 | * @return {Promise} - the promise for the http request |
| 712 | */ |
| 713 | deleteFile(branch, path, cb) { |
| 714 | return this.getSha(branch, path) |
| 715 | .then((response) => { |
| 716 | const deleteCommit = { |
| 717 | message: `Delete the file at '${path}'`, |
| 718 | sha: response.data.sha, |
| 719 | branch, |
| 720 | }; |
| 721 | return this._request('DELETE', `/repos/${this.__fullname}/contents/${path}`, deleteCommit, cb); |
| 722 | }); |
| 723 | } |
| 724 | |
| 725 | /** |
| 726 | * Change all references in a repo from oldPath to new_path |
no test coverage detected