@@ -142,14 +142,7 @@ static int show_ignored_in_status, have_option_m;
142
142
static const char * only_include_assumed ;
143
143
static struct strbuf message = STRBUF_INIT ;
144
144
145
- static enum status_format {
146
- STATUS_FORMAT_NONE = 0 ,
147
- STATUS_FORMAT_LONG ,
148
- STATUS_FORMAT_SHORT ,
149
- STATUS_FORMAT_PORCELAIN ,
150
-
151
- STATUS_FORMAT_UNSPECIFIED
152
- } status_format = STATUS_FORMAT_UNSPECIFIED ;
145
+ static enum wt_status_format status_format = STATUS_FORMAT_UNSPECIFIED ;
153
146
154
147
static int opt_parse_m (const struct option * opt , const char * arg , int unset )
155
148
{
@@ -500,24 +493,11 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
500
493
s -> fp = fp ;
501
494
s -> nowarn = nowarn ;
502
495
s -> is_initial = get_sha1 (s -> reference , sha1 ) ? 1 : 0 ;
496
+ s -> status_format = status_format ;
497
+ s -> ignore_submodule_arg = ignore_submodule_arg ;
503
498
504
499
wt_status_collect (s );
505
-
506
- switch (status_format ) {
507
- case STATUS_FORMAT_SHORT :
508
- wt_shortstatus_print (s );
509
- break ;
510
- case STATUS_FORMAT_PORCELAIN :
511
- wt_porcelain_print (s );
512
- break ;
513
- case STATUS_FORMAT_UNSPECIFIED :
514
- die ("BUG: finalize_deferred_config() should have been called" );
515
- break ;
516
- case STATUS_FORMAT_NONE :
517
- case STATUS_FORMAT_LONG :
518
- wt_longstatus_print (s );
519
- break ;
520
- }
500
+ wt_status_print (s );
521
501
522
502
return s -> commitable ;
523
503
}
@@ -1099,7 +1079,7 @@ static const char *read_commit_message(const char *name)
1099
1079
* is not in effect here.
1100
1080
*/
1101
1081
static struct status_deferred_config {
1102
- enum status_format status_format ;
1082
+ enum wt_status_format status_format ;
1103
1083
int show_branch ;
1104
1084
} status_deferred_config = {
1105
1085
STATUS_FORMAT_UNSPECIFIED ,
@@ -1381,6 +1361,9 @@ int cmd_status(int argc, const char **argv, const char *prefix)
1381
1361
1382
1362
s .is_initial = get_sha1 (s .reference , sha1 ) ? 1 : 0 ;
1383
1363
s .ignore_submodule_arg = ignore_submodule_arg ;
1364
+ s .status_format = status_format ;
1365
+ s .verbose = verbose ;
1366
+
1384
1367
wt_status_collect (& s );
1385
1368
1386
1369
if (0 <= fd )
@@ -1389,23 +1372,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
1389
1372
if (s .relative_paths )
1390
1373
s .prefix = prefix ;
1391
1374
1392
- switch (status_format ) {
1393
- case STATUS_FORMAT_SHORT :
1394
- wt_shortstatus_print (& s );
1395
- break ;
1396
- case STATUS_FORMAT_PORCELAIN :
1397
- wt_porcelain_print (& s );
1398
- break ;
1399
- case STATUS_FORMAT_UNSPECIFIED :
1400
- die ("BUG: finalize_deferred_config() should have been called" );
1401
- break ;
1402
- case STATUS_FORMAT_NONE :
1403
- case STATUS_FORMAT_LONG :
1404
- s .verbose = verbose ;
1405
- s .ignore_submodule_arg = ignore_submodule_arg ;
1406
- wt_longstatus_print (& s );
1407
- break ;
1408
- }
1375
+ wt_status_print (& s );
1409
1376
return 0 ;
1410
1377
}
1411
1378
0 commit comments