From 00ac2fbad53c44584ab072bfc8b43e8103d72645 Mon Sep 17 00:00:00 2001 From: Yu Yu Date: Sat, 7 Sep 2019 08:51:43 +0800 Subject: [PATCH 1/4] Update package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index b3c78db3..ae5b9c70 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "scripts": { "clean": "gulp clean", "build": "gulp build", + "postinstall": "gulp build", "test": "mocha --opts ./mocha.opts test/*.spec.js", "test-coverage": "NODE_ENV=test nyc mocha --opts ./mocha.opts test/*.spec.js", "test-verbose": "DEBUG=github* npm test", From 3be7ecb3a29eef26fe2e5aec41d8907663b77e1d Mon Sep 17 00:00:00 2001 From: Yu Yu Date: Sat, 7 Sep 2019 08:53:18 +0800 Subject: [PATCH 2/4] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ae5b9c70..32d2596b 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "scripts": { "clean": "gulp clean", "build": "gulp build", - "postinstall": "gulp build", + "postinstall": "npm run build", "test": "mocha --opts ./mocha.opts test/*.spec.js", "test-coverage": "NODE_ENV=test nyc mocha --opts ./mocha.opts test/*.spec.js", "test-verbose": "DEBUG=github* npm test", From 0d59d2befcd7d3383c98827286ff00a082fa6ea5 Mon Sep 17 00:00:00 2001 From: Yu Yu Date: Sat, 7 Sep 2019 09:31:16 +0800 Subject: [PATCH 3/4] Update package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 32d2596b..b3c78db3 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "scripts": { "clean": "gulp clean", "build": "gulp build", - "postinstall": "npm run build", "test": "mocha --opts ./mocha.opts test/*.spec.js", "test-coverage": "NODE_ENV=test nyc mocha --opts ./mocha.opts test/*.spec.js", "test-verbose": "DEBUG=github* npm test", From be2a19edd0ede048d86d0fbdad9b802910e28878 Mon Sep 17 00:00:00 2001 From: Yu Yu Date: Sat, 7 Sep 2019 15:51:42 +0800 Subject: [PATCH 4/4] Update Repository.js --- lib/Repository.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/Repository.js b/lib/Repository.js index 3908775c..039df9b0 100644 --- a/lib/Repository.js +++ b/lib/Repository.js @@ -563,6 +563,21 @@ class Repository extends Requestable { }, cb); }); } + + /** + * Delete a branch. + * @param {string} branch - the name of the branch would be deleted + * @param {Requestable.callback} cb - will receive the commit data for the head of the new branch + * @return {Promise} - the promise for the http request + */ + deleteBranch(branch, cb) { + return this.getRef(`heads/${branch}`) + .then((response) => { + return this.deleteRef({ + ref: `refs/heads/${branch}`, + }, cb); + }); + } /** * Create a new pull request