Skip to content

Commit

Permalink
fix: git push with upstream specified (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunjae Lee authored Aug 21, 2019
1 parent 9ba45ff commit ef5eccd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
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

0 comments on commit ef5eccd

Please sign in to comment.