Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: git push with upstream specified #206

Merged
merged 2 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/shipjs/src/flow/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import checkHub from '../step/checkHub';
import validate from '../step/prepare/validate';
import validateMergeStrategy from '../step/prepare/validateMergeStrategy';
import pull from '../step/pull';
import push from '../step/push';
import push from '../step/prepare/push';
import getNextVersion from '../step/prepare/getNextVersion';
import confirmNextVersion from '../step/prepare/confirmNextVersion';
import prepareStagingBranch from '../step/prepare/prepareStagingBranch';
Expand Down Expand Up @@ -40,7 +40,7 @@ async function prepare({
const { currentVersion, baseBranch } = validate({ config, dir });
validateMergeStrategy({ config });
pull({ dir, dryRun });
push({ dir, dryRun });
push({ config, currentBranch: baseBranch, dir, dryRun });
let { nextVersion } = getNextVersion({ dir });
nextVersion = await confirmNextVersion({
yes,
Expand Down
7 changes: 7 additions & 0 deletions packages/shipjs/src/step/prepare/push.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runStep from '../runStep';

export default ({ config, currentBranch, dir, dryRun }) =>
runStep({ title: 'Pushing to remote.' }, ({ run }) => {
const { remote } = config;
run(`git push ${remote} ${currentBranch}`, dir, dryRun);
});
6 changes: 0 additions & 6 deletions packages/shipjs/src/step/push.js

This file was deleted.

6 changes: 3 additions & 3 deletions packages/shipjs/src/step/release/gitPush.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default ({ tagName, config, dir, dryRun }) =>
if (currentBranch === destinationBranch) {
run(pushCommand, dir, dryRun);
} else {
// currentBranch: 'release/legacy'
// destinationBranch: 'legacy'
// flow: legacy -> release/legacy -> (here) legacy
// currentBranch: 'master'
// destinationBranch: 'develop'
// flow: develop -> master -> (here) develop
run(`git checkout ${destinationBranch}`, dir, dryRun);
run(`git merge ${currentBranch}`, dir, dryRun);
run(pushCommand, dir, dryRun);
Expand Down