Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Default PR reviewer/forwarder should be used when that certain flag i…
Browse files Browse the repository at this point in the history
…s empty. Otherwise it will cause conflicts with other commands #283
  • Loading branch information
Zeno Rocha committed Sep 9, 2014
1 parent fda8180 commit bb7f378
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/cmds/pull-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ PullRequest.prototype.run = function() {
options = instance.options,
fetchType;

options.fwd = options.fwd || config.default_pr_forwarder;
options.number = options.number || instance.getPullRequestNumberFromBranch_();
options.pullBranch = instance.getBranchNameFromPullNumber_(options.number);
options.state = options.state || PullRequest.STATE_OPEN;
options.submit = options.submit || config.default_pr_reviewer;

if (options.browser) {
instance.browser(options.user, options.repo, options.number);
Expand Down Expand Up @@ -211,6 +209,10 @@ PullRequest.prototype.run = function() {
});
}

if (options.fwd === '') {
options.fwd = config.default_pr_forwarder;
}

if (options.fwd) {
hooks.invoke('pull-request.fwd', instance, function(afterHooksCallback) {
logger.logTemplate(
Expand Down Expand Up @@ -283,6 +285,10 @@ PullRequest.prototype.run = function() {
});
}

if (options.submit === '') {
options.submit = config.default_pr_reviewer;
}

if (options.submit) {
hooks.invoke('pull-request.submit', instance, function(afterHooksCallback) {
logger.logTemplate(
Expand Down

0 comments on commit bb7f378

Please sign in to comment.