@@ -2118,7 +2118,7 @@ static int parse_opt_patchformat(const struct option *opt, const char *arg, int
2118
2118
return 0 ;
2119
2119
}
2120
2120
2121
- enum resume_mode {
2121
+ enum resume_type {
2122
2122
RESUME_FALSE = 0 ,
2123
2123
RESUME_APPLY ,
2124
2124
RESUME_RESOLVED ,
@@ -2128,6 +2128,10 @@ enum resume_mode {
2128
2128
RESUME_SHOW_PATCH
2129
2129
};
2130
2130
2131
+ struct resume_mode {
2132
+ enum resume_type mode ;
2133
+ };
2134
+
2131
2135
static int git_am_config (const char * k , const char * v , void * cb )
2132
2136
{
2133
2137
int status ;
@@ -2145,7 +2149,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2145
2149
int binary = -1 ;
2146
2150
int keep_cr = -1 ;
2147
2151
int patch_format = PATCH_FORMAT_UNKNOWN ;
2148
- enum resume_mode resume = RESUME_FALSE ;
2152
+ struct resume_mode resume = { . mode = RESUME_FALSE } ;
2149
2153
int in_progress ;
2150
2154
int ret = 0 ;
2151
2155
@@ -2214,22 +2218,22 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2214
2218
PARSE_OPT_NOARG ),
2215
2219
OPT_STRING (0 , "resolvemsg" , & state .resolvemsg , NULL ,
2216
2220
N_ ("override error message when patch failure occurs" )),
2217
- OPT_CMDMODE (0 , "continue" , & resume ,
2221
+ OPT_CMDMODE (0 , "continue" , & resume . mode ,
2218
2222
N_ ("continue applying patches after resolving a conflict" ),
2219
2223
RESUME_RESOLVED ),
2220
- OPT_CMDMODE ('r' , "resolved" , & resume ,
2224
+ OPT_CMDMODE ('r' , "resolved" , & resume . mode ,
2221
2225
N_ ("synonyms for --continue" ),
2222
2226
RESUME_RESOLVED ),
2223
- OPT_CMDMODE (0 , "skip" , & resume ,
2227
+ OPT_CMDMODE (0 , "skip" , & resume . mode ,
2224
2228
N_ ("skip the current patch" ),
2225
2229
RESUME_SKIP ),
2226
- OPT_CMDMODE (0 , "abort" , & resume ,
2230
+ OPT_CMDMODE (0 , "abort" , & resume . mode ,
2227
2231
N_ ("restore the original branch and abort the patching operation." ),
2228
2232
RESUME_ABORT ),
2229
- OPT_CMDMODE (0 , "quit" , & resume ,
2233
+ OPT_CMDMODE (0 , "quit" , & resume . mode ,
2230
2234
N_ ("abort the patching operation but keep HEAD where it is." ),
2231
2235
RESUME_QUIT ),
2232
- OPT_CMDMODE (0 , "show-current-patch" , & resume ,
2236
+ OPT_CMDMODE (0 , "show-current-patch" , & resume . mode ,
2233
2237
N_ ("show the patch being applied." ),
2234
2238
RESUME_SHOW_PATCH ),
2235
2239
OPT_BOOL (0 , "committer-date-is-author-date" ,
@@ -2281,12 +2285,12 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2281
2285
* intend to feed us a patch but wanted to continue
2282
2286
* unattended.
2283
2287
*/
2284
- if (argc || (resume == RESUME_FALSE && !isatty (0 )))
2288
+ if (argc || (resume . mode == RESUME_FALSE && !isatty (0 )))
2285
2289
die (_ ("previous rebase directory %s still exists but mbox given." ),
2286
2290
state .dir );
2287
2291
2288
- if (resume == RESUME_FALSE )
2289
- resume = RESUME_APPLY ;
2292
+ if (resume . mode == RESUME_FALSE )
2293
+ resume . mode = RESUME_APPLY ;
2290
2294
2291
2295
if (state .signoff == SIGNOFF_EXPLICIT )
2292
2296
am_append_signoff (& state );
@@ -2300,7 +2304,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2300
2304
* stray directories.
2301
2305
*/
2302
2306
if (file_exists (state .dir ) && !state .rebasing ) {
2303
- if (resume == RESUME_ABORT || resume == RESUME_QUIT ) {
2307
+ if (resume . mode == RESUME_ABORT || resume . mode == RESUME_QUIT ) {
2304
2308
am_destroy (& state );
2305
2309
am_state_release (& state );
2306
2310
return 0 ;
@@ -2311,7 +2315,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2311
2315
state .dir );
2312
2316
}
2313
2317
2314
- if (resume )
2318
+ if (resume . mode )
2315
2319
die (_ ("Resolve operation not in progress, we are not resuming." ));
2316
2320
2317
2321
for (i = 0 ; i < argc ; i ++ ) {
@@ -2329,7 +2333,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2329
2333
argv_array_clear (& paths );
2330
2334
}
2331
2335
2332
- switch (resume ) {
2336
+ switch (resume . mode ) {
2333
2337
case RESUME_FALSE :
2334
2338
am_run (& state , 0 );
2335
2339
break ;
0 commit comments