File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -808,6 +808,17 @@ void wt_status_truncate_message_at_cut_line(struct strbuf *buf)
808808 strbuf_release (& pattern );
809809}
810810
811+ void wt_status_add_cut_line (FILE * fp )
812+ {
813+ const char * explanation = _ ("Do not touch the line above.\nEverything below will be removed." );
814+ struct strbuf buf = STRBUF_INIT ;
815+
816+ fprintf (fp , "%c %s" , comment_line_char , cut_line );
817+ strbuf_add_commented_lines (& buf , explanation , strlen (explanation ));
818+ fputs (buf .buf , fp );
819+ strbuf_release (& buf );
820+ }
821+
811822static void wt_status_print_verbose (struct wt_status * s )
812823{
813824 struct rev_info rev ;
@@ -833,14 +844,8 @@ static void wt_status_print_verbose(struct wt_status *s)
833844 * diff before committing.
834845 */
835846 if (s -> fp != stdout ) {
836- const char * explanation = _ ("Do not touch the line above.\nEverything below will be removed." );
837- struct strbuf buf = STRBUF_INIT ;
838-
839847 rev .diffopt .use_color = 0 ;
840- fprintf (s -> fp , "%c %s" , comment_line_char , cut_line );
841- strbuf_add_commented_lines (& buf , explanation , strlen (explanation ));
842- fputs (buf .buf , s -> fp );
843- strbuf_release (& buf );
848+ wt_status_add_cut_line (s -> fp );
844849 }
845850 run_diff_index (& rev , 1 );
846851}
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ struct wt_status_state {
9292};
9393
9494void wt_status_truncate_message_at_cut_line (struct strbuf * );
95+ void wt_status_add_cut_line (FILE * fp );
9596void wt_status_prepare (struct wt_status * s );
9697void wt_status_print (struct wt_status * s );
9798void wt_status_collect (struct wt_status * s );
You can’t perform that action at this time.
0 commit comments