@@ -23,14 +23,8 @@ async function fetchAll() {
23
23
}
24
24
25
25
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
+
34
28
const { projectName, sprintNumber} = await inquirer . askProjectNameAndSprintNumber ( config ) ;
35
29
const { confirm} = await inquirer . confirmFinishing (
36
30
`Are you sure, you finished sprint ${ sprintNumber } of ${ projectName } `
@@ -87,14 +81,9 @@ async function finishHotfix() {
87
81
if ( ! branch ) {
88
82
throw new Error ( 'You are not in any branch (detached HEAD?)' ) ;
89
83
}
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
+
98
87
const { issueName, issueNumber} = toIssueNumberAndName ( branch , HOTFIX_PREFIX ) ;
99
88
const { confirm} = await inquirer . confirmFinishing ( `Are you sure, you finished ${ issueName } ` ) ;
100
89
if ( ! confirm ) {
@@ -124,14 +113,9 @@ async function finishFeature(config) {
124
113
if ( ! branch ) {
125
114
throw new Error ( 'You are not in any branch (detached HEAD?)' ) ;
126
115
}
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
+
135
119
const { projectName, sprintNumber} = await inquirer . askProjectNameAndSprintNumber ( config ) ;
136
120
const baseBranch = `${ projectName } /sprint-${ sprintNumber } ` ;
137
121
const { confirm} = await inquirer . confirmFinishing ( `Are you sure, you finished ${ branch } of ${ baseBranch } ` ) ;
0 commit comments