@@ -185,31 +185,12 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,
185
185
wt_status_print_trailer (s );
186
186
}
187
187
188
- static void wt_status_print_initial (struct wt_status * s )
189
- {
190
- int i ;
191
- struct strbuf buf = STRBUF_INIT ;
192
-
193
- if (active_nr ) {
194
- s -> commitable = 1 ;
195
- wt_status_print_cached_header (s );
196
- }
197
- for (i = 0 ; i < active_nr ; i ++ ) {
198
- color_fprintf (s -> fp , color (WT_STATUS_HEADER ), "#\t" );
199
- color_fprintf_ln (s -> fp , color (WT_STATUS_UPDATED ), "new file: %s" ,
200
- quote_path (active_cache [i ]-> name , -1 ,
201
- & buf , s -> prefix ));
202
- }
203
- if (active_nr )
204
- wt_status_print_trailer (s );
205
- strbuf_release (& buf );
206
- }
207
-
208
188
static void wt_status_print_updated (struct wt_status * s )
209
189
{
210
190
struct rev_info rev ;
211
191
init_revisions (& rev , NULL );
212
- setup_revisions (0 , NULL , & rev , s -> reference );
192
+ setup_revisions (0 , NULL , & rev ,
193
+ s -> is_initial ? EMPTY_TREE_SHA1_HEX : s -> reference );
213
194
rev .diffopt .output_format |= DIFF_FORMAT_CALLBACK ;
214
195
rev .diffopt .format_callback = wt_status_print_updated_cb ;
215
196
rev .diffopt .format_callback_data = s ;
@@ -298,7 +279,8 @@ static void wt_status_print_verbose(struct wt_status *s)
298
279
struct rev_info rev ;
299
280
300
281
init_revisions (& rev , NULL );
301
- setup_revisions (0 , NULL , & rev , s -> reference );
282
+ setup_revisions (0 , NULL , & rev ,
283
+ s -> is_initial ? EMPTY_TREE_SHA1_HEX : s -> reference );
302
284
rev .diffopt .output_format |= DIFF_FORMAT_PATCH ;
303
285
rev .diffopt .detect_rename = 1 ;
304
286
DIFF_OPT_SET (& rev .diffopt , ALLOW_TEXTCONV );
@@ -360,12 +342,9 @@ void wt_status_print(struct wt_status *s)
360
342
color_fprintf_ln (s -> fp , color (WT_STATUS_HEADER ), "#" );
361
343
color_fprintf_ln (s -> fp , color (WT_STATUS_HEADER ), "# Initial commit" );
362
344
color_fprintf_ln (s -> fp , color (WT_STATUS_HEADER ), "#" );
363
- wt_status_print_initial (s );
364
- }
365
- else {
366
- wt_status_print_updated (s );
367
345
}
368
346
347
+ wt_status_print_updated (s );
369
348
wt_status_print_changed (s );
370
349
if (wt_status_submodule_summary )
371
350
wt_status_print_submodule_summary (s );
@@ -374,7 +353,7 @@ void wt_status_print(struct wt_status *s)
374
353
else if (s -> commitable )
375
354
fprintf (s -> fp , "# Untracked files not listed (use -u option to show untracked files)\n" );
376
355
377
- if (s -> verbose && ! s -> is_initial )
356
+ if (s -> verbose )
378
357
wt_status_print_verbose (s );
379
358
if (!s -> commitable ) {
380
359
if (s -> amend )
0 commit comments