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

Method deleteFile

lib/Repository.js:713–723  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 1

repository.spec.jsFile · 0.80

Calls 2

getShaMethod · 0.95
_requestMethod · 0.80

Tested by

no test coverage detected