Comparing version 1.5.0 to 1.5.1
@@ -393,2 +393,3 @@ /* | ||
operations, | ||
submittedPull, | ||
pull; | ||
@@ -398,7 +399,11 @@ | ||
function(callback) { | ||
instance.fetch(PullRequest.FETCH_TYPE_SILENT, callback); | ||
instance.fetch(PullRequest.FETCH_TYPE_SILENT, function(err, data) { | ||
pull = data; | ||
callback(err); | ||
}); | ||
}, | ||
function(callback) { | ||
options.title = pull.title; | ||
instance.submit(options.fwd, function(err, data) { | ||
pull = data; | ||
submittedPull = data; | ||
callback(err); | ||
@@ -413,3 +418,3 @@ }); | ||
async.series(operations, function(err) { | ||
opt_callback && opt_callback(err, pull); | ||
opt_callback && opt_callback(err, submittedPull); | ||
}); | ||
@@ -601,3 +606,2 @@ }; | ||
operations, | ||
title, | ||
pullBranch; | ||
@@ -612,6 +616,11 @@ | ||
function(callback) { | ||
git.getLastCommitMessage(function (err, data) { | ||
title = data; | ||
callback(err); | ||
}); | ||
if (options.title) { | ||
callback(); | ||
} | ||
else { | ||
git.getLastCommitMessage(pullBranch, function (err, data) { | ||
options.title = data; | ||
callback(err); | ||
}); | ||
} | ||
}, | ||
@@ -632,3 +641,3 @@ function(callback) { | ||
payload.body = options.description; | ||
payload.title = options.title || title; | ||
payload.title = options.title; | ||
base.github.pullRequests.create(payload, callback); | ||
@@ -635,0 +644,0 @@ } |
@@ -69,4 +69,4 @@ /* | ||
exports.getLastCommitMessage = function(opt_callback) { | ||
exports.exec('log', ['-1', '--pretty=%B', '--no-merges'], function(err, data) { | ||
exports.getLastCommitMessage = function(opt_branch, opt_callback) { | ||
exports.exec('log', ['-1', '--first-parent', '--no-merges', '--pretty=%s', opt_branch || ''], function(err, data) { | ||
opt_callback(err, data.trim()); | ||
@@ -73,0 +73,0 @@ }); |
Software License Agreement (BSD License) | ||
Copyright (c) 2013, Eduardo A. Lundgren Melo. | ||
Copyright (c) 2013, Eduardo Antonio Lundgren Melo and Zeno Rocha Bueno Netto. | ||
All rights reserved. | ||
@@ -18,5 +18,5 @@ | ||
* The name of Eduardo A. Lundgren Melo may not be used to endorse or promote products | ||
* The name of Eduardo Antonio Lundgren Melo and Zeno Rocha Bueno Netto may not be used to endorse or promote products | ||
derived from this software without specific prior | ||
written permission of Eduardo A. Lundgren Melo. | ||
written permission of Eduardo Antonio Lundgren Melo and Zeno Rocha Bueno Netto. | ||
@@ -30,3 +30,2 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED | ||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
{ | ||
"name": "gh", | ||
"description": "GitHub command line tools.", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"homepage": "http://nodegh.io", | ||
@@ -33,3 +33,3 @@ "author": { | ||
"scripts": { | ||
"lint": "node_modules/.bin/jshint lib/ bin/", | ||
"lint": "node_modules/.bin/jshint bin/ lib/ test/", | ||
"test": "node_modules/.bin/mocha --reporter list" | ||
@@ -36,0 +36,0 @@ }, |
@@ -21,2 +21,3 @@ # Node GH [![Build Status](https://secure.travis-ci.org/node-gh/gh.png?branch=master)](https://travis-ci.org/node-gh/gh) [![NPM version](https://badge.fury.io/js/gh.png)](http://badge.fury.io/js/gh) [![Dependency Status](https://david-dm.org/node-gh/gh.png)](https://david-dm.org/node-gh/gh) | ||
* [Config](#config) | ||
* [Test](#test) | ||
* [Team](#team) | ||
@@ -749,2 +750,16 @@ * [Contributing](#contributing) | ||
## Test | ||
* Run [JSHint](http://www.jshint.com/), a tool to detect errors and potential problems. | ||
``` | ||
npm run-script lint | ||
``` | ||
* Run [Mocha](http://visionmedia.github.io/mocha/), a unit test framework. | ||
``` | ||
npm run-script test | ||
``` | ||
## Team | ||
@@ -762,4 +777,10 @@ | ||
Or create new plugins by copying and editing the content of [GH Boilerplate](https://github.com/node-gh/gh-boilerplate). | ||
## History | ||
* **v1.5.1** September 15, 2013 | ||
* Use original pull request title when forwarding a pull request | ||
* Use only the first line of the commit when creating pull requests | ||
* Fix message when forwarding a pull request | ||
* **v1.5.0** September 13, 2013 | ||
@@ -766,0 +787,0 @@ * Rename repository to `gh` |
@@ -8,7 +8,10 @@ /* | ||
* @author Rodrigo Vidal <rodrigovidal777@gmail.com> | ||
* @author Zeno Rocha <zno.rocha@gmail.com> | ||
*/ | ||
var assert = require("assert"); | ||
var git = require("../lib/git"); | ||
// -- Requires ----------------------------------------------------------------- | ||
var assert = require('assert'), | ||
git = require('../lib/git'); | ||
// -- Suites ------------------------------------------------------------------- | ||
describe('Git Module Tests', function(){ | ||
@@ -18,11 +21,11 @@ describe('Function parseRemoteUrl', function(){ | ||
it('should parse remote url with score on repo name', function(){ | ||
var p = git.parseRemoteUrl("git@github.com:eduardolundgren/node-gh.git"); | ||
assert.equal("eduardolundgren", p[0]); | ||
assert.equal("node-gh", p[1]); | ||
var p = git.parseRemoteUrl('git@github.com:eduardolundgren/node-gh.git'); | ||
assert.equal('eduardolundgren', p[0]); | ||
assert.equal('node-gh', p[1]); | ||
}); | ||
it('should parse remote url with score on username', function(){ | ||
var p = git.parseRemoteUrl("git@github.com:elixir-lang/elixir.git"); | ||
assert.equal("elixir-lang", p[0]); | ||
assert.equal("elixir", p[1]); | ||
var p = git.parseRemoteUrl('git@github.com:elixir-lang/elixir.git'); | ||
assert.equal('elixir-lang', p[0]); | ||
assert.equal('elixir', p[1]); | ||
}); | ||
@@ -33,11 +36,11 @@ }); | ||
it('should parse remote url with score on repo name', function(){ | ||
var p = git.parseRemoteUrl("https://github.com/eduardolundgren/node-gh.git"); | ||
assert.equal("eduardolundgren", p[0]); | ||
assert.equal("node-gh", p[1]); | ||
var p = git.parseRemoteUrl('https://github.com/eduardolundgren/node-gh.git'); | ||
assert.equal('eduardolundgren', p[0]); | ||
assert.equal('node-gh', p[1]); | ||
}); | ||
it('should parse remote url with score on username', function(){ | ||
var p = git.parseRemoteUrl("https://github.com/elixir-lang/elixir.git"); | ||
assert.equal("elixir-lang", p[0]); | ||
assert.equal("elixir", p[1]); | ||
var p = git.parseRemoteUrl('https://github.com/elixir-lang/elixir.git'); | ||
assert.equal('elixir-lang', p[0]); | ||
assert.equal('elixir', p[1]); | ||
}); | ||
@@ -44,0 +47,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101668
2241
893