Skip to content

Commit 91d605b

Browse files
author
Ice5050
committed
fix: use doStash() instead of promptStash()
1 parent 34db7be commit 91d605b

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

lib/git.js

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ async function fetchAll() {
2323
}
2424

2525
async function finishSprint(config) {
26-
if (!await isClean()) {
27-
const {confirm} = await inquirer.promptStash();
28-
if (confirm) {
29-
await stash();
30-
} else {
31-
throw new Error('Operation aborted.');
32-
}
33-
}
26+
await doStash();
27+
3428
const {projectName, sprintNumber} = await inquirer.askProjectNameAndSprintNumber(config);
3529
const {confirm} = await inquirer.confirmFinishing(
3630
`Are you sure, you finished sprint ${sprintNumber} of ${projectName}`
@@ -87,14 +81,9 @@ async function finishHotfix() {
8781
if (!branch) {
8882
throw new Error('You are not in any branch (detached HEAD?)');
8983
}
90-
if (!await isClean()) {
91-
const {confirm} = await inquirer.promptStash();
92-
if (confirm) {
93-
await stash();
94-
} else {
95-
throw new Error('Operation aborted.');
96-
}
97-
}
84+
85+
await doStash();
86+
9887
const {issueName, issueNumber} = toIssueNumberAndName(branch, HOTFIX_PREFIX);
9988
const {confirm} = await inquirer.confirmFinishing(`Are you sure, you finished ${issueName}`);
10089
if (!confirm) {
@@ -124,14 +113,9 @@ async function finishFeature(config) {
124113
if (!branch) {
125114
throw new Error('You are not in any branch (detached HEAD?)');
126115
}
127-
if (!await isClean()) {
128-
const {confirm} = await inquirer.promptStash();
129-
if (confirm) {
130-
await stash();
131-
} else {
132-
throw new Error('Operation aborted.');
133-
}
134-
}
116+
117+
await doStash();
118+
135119
const {projectName, sprintNumber} = await inquirer.askProjectNameAndSprintNumber(config);
136120
const baseBranch = `${projectName}/sprint-${sprintNumber}`;
137121
const {confirm} = await inquirer.confirmFinishing(`Are you sure, you finished ${branch} of ${baseBranch}`);

0 commit comments

Comments
 (0)