Skip to content

Commit

Permalink
Merge pull request #41 from pmiossec/fix_branch_option
Browse files Browse the repository at this point in the history
Fix branch option
  • Loading branch information
rafinskipg committed May 8, 2016
2 parents 2e50373 + 4ce6128 commit 6247118
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tasks/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ if (process.argv.join('').replace(/\\/g,'/').indexOf('/grunt') === -1) {
options.app_name = program.app_name;
}

if (program.branch_name){
options.branch_name = program.branch_name;
if (program.branch){
options.branch_name = program.branch;
console.log(' - Branch %s', program.branch);
}
if (program.debug){
Expand Down
2 changes: 1 addition & 1 deletion tasks/lib/get-gitlog-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var debug = require('debug')('changelog:getGitLogCommands');

function getGitLogCommands() {
debug('getting log commands');
this.cmd.gitLog = 'git log ' + this.options.branch_name + ' --grep="%s" -E --format=%s %s..HEAD';
this.cmd.gitLog = 'git log --grep="%s" -E --format=%s %s..' + (this.options.branch_name ? this.options.branch_name : 'HEAD');
this.cmd.gitLogNoTag = 'git log ' + this.options.branch_name + ' --grep="%s" -E --format=%s';
}

Expand Down
3 changes: 2 additions & 1 deletion test/git_changelog_generate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ describe('git_changelog_generate.js', function() {
changelog.options.branch_name = branch_name;
changelog.getGitLogCommands();

expect(changelog.cmd.gitLog).to.include('git log ' + branch_name);
expect(changelog.cmd.gitLog).to.include('git log ')
.and.include('..' + branch_name);
expect(changelog.cmd.gitLogNoTag).to.include('git log ' + branch_name);
});

Expand Down

0 comments on commit 6247118

Please sign in to comment.