File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -6828,18 +6828,38 @@ void diff_flush(struct diff_options *options)
68286828 DIFF_FORMAT_NAME |
68296829 DIFF_FORMAT_NAME_STATUS |
68306830 DIFF_FORMAT_CHECKDIFF )) {
6831+ /*
6832+ * make sure diff_Flush_patch_quietly() to be silent.
6833+ */
6834+ FILE * dev_null = NULL ;
6835+ int saved_color_moved = options -> color_moved ;
6836+
6837+ if (options -> flags .diff_from_contents ) {
6838+ dev_null = xfopen ("/dev/null" , "w" );
6839+ options -> color_moved = 0 ;
6840+ }
68316841 for (i = 0 ; i < q -> nr ; i ++ ) {
68326842 struct diff_filepair * p = q -> queue [i ];
68336843
68346844 if (!check_pair_status (p ))
68356845 continue ;
68366846
6837- if (options -> flags .diff_from_contents &&
6838- ! diff_flush_patch_quietly ( p , options ))
6839- continue ;
6847+ if (options -> flags .diff_from_contents ) {
6848+ FILE * saved_file = options -> file ;
6849+ int found_changes ;
68406850
6851+ options -> file = dev_null ;
6852+ found_changes = diff_flush_patch_quietly (p , options );
6853+ options -> file = saved_file ;
6854+ if (!found_changes )
6855+ continue ;
6856+ }
68416857 flush_one_pair (p , options );
68426858 }
6859+ if (options -> flags .diff_from_contents ) {
6860+ fclose (dev_null );
6861+ options -> color_moved = saved_color_moved ;
6862+ }
68436863 separator ++ ;
68446864 }
68456865
You can’t perform that action at this time.
0 commit comments