Skip to content

Commit

Permalink
fix: use doStash() instead of promptStash()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice5050 committed Jul 5, 2019
1 parent 34db7be commit 91d605b
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ async function fetchAll() {
}

async function finishSprint(config) {
if (!await isClean()) {
const {confirm} = await inquirer.promptStash();
if (confirm) {
await stash();
} else {
throw new Error('Operation aborted.');
}
}
await doStash();

const {projectName, sprintNumber} = await inquirer.askProjectNameAndSprintNumber(config);
const {confirm} = await inquirer.confirmFinishing(
`Are you sure, you finished sprint ${sprintNumber} of ${projectName}`
Expand Down Expand Up @@ -87,14 +81,9 @@ async function finishHotfix() {
if (!branch) {
throw new Error('You are not in any branch (detached HEAD?)');
}
if (!await isClean()) {
const {confirm} = await inquirer.promptStash();
if (confirm) {
await stash();
} else {
throw new Error('Operation aborted.');
}
}

await doStash();

const {issueName, issueNumber} = toIssueNumberAndName(branch, HOTFIX_PREFIX);
const {confirm} = await inquirer.confirmFinishing(`Are you sure, you finished ${issueName}`);
if (!confirm) {
Expand Down Expand Up @@ -124,14 +113,9 @@ async function finishFeature(config) {
if (!branch) {
throw new Error('You are not in any branch (detached HEAD?)');
}
if (!await isClean()) {
const {confirm} = await inquirer.promptStash();
if (confirm) {
await stash();
} else {
throw new Error('Operation aborted.');
}
}

await doStash();

const {projectName, sprintNumber} = await inquirer.askProjectNameAndSprintNumber(config);
const baseBranch = `${projectName}/sprint-${sprintNumber}`;
const {confirm} = await inquirer.confirmFinishing(`Are you sure, you finished ${branch} of ${baseBranch}`);
Expand Down

0 comments on commit 91d605b

Please sign in to comment.