Skip to content

Commit

Permalink
fix: remove unnecessary branch parameter from push function
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Nov 30, 2018
1 parent 7a9922a commit ffe1062
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -107,7 +107,7 @@ async function run(context, plugins) {
} else {
// Create the tag before calling the publish plugins as some require the tag to exists
await tag(nextRelease.gitTag, {cwd, env});
await push(options.repositoryUrl, options.branch, {cwd, env});
await push(options.repositoryUrl, {cwd, env});
logger.success(`Created tag ${nextRelease.gitTag}`);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/git.js
Expand Up @@ -143,12 +143,11 @@ async function tag(tagName, execaOpts) {
* Push to the remote repository.
*
* @param {String} repositoryUrl The remote repository URL.
* @param {String} branch The branch to push.
* @param {Object} [execaOpts] Options to pass to `execa`.
*
* @throws {Error} if the push failed.
*/
async function push(repositoryUrl, branch, execaOpts) {
async function push(repositoryUrl, execaOpts) {
await execa('git', ['push', '--tags', repositoryUrl], execaOpts);
}

Expand Down
4 changes: 2 additions & 2 deletions test/git.test.js
Expand Up @@ -157,7 +157,7 @@ test('Push tag to remote repository', async t => {
const commits = await gitCommits(['Test commit'], {cwd});

await tag('tag_name', {cwd});
await push(repositoryUrl, 'master', {cwd});
await push(repositoryUrl, {cwd});

t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
});
Expand All @@ -171,7 +171,7 @@ test('Push tag to remote repository with remote branch ahaed', async t => {
await gitPush('origin', 'master', {cwd: tmpRepo});

await tag('tag_name', {cwd});
await push(repositoryUrl, 'master', {cwd});
await push(repositoryUrl, {cwd});

t.is(await gitRemoteTagHead(repositoryUrl, 'tag_name', {cwd}), commits[0].hash);
});
Expand Down

0 comments on commit ffe1062

Please sign in to comment.