File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -6890,6 +6890,15 @@ void diff_flush(struct diff_options *options)
68906890 if (output_format & DIFF_FORMAT_NO_OUTPUT &&
68916891 options -> flags .exit_with_status &&
68926892 options -> flags .diff_from_contents ) {
6893+ /*
6894+ * run diff_flush_patch for the exit status. setting
6895+ * options->file to /dev/null should be safe, because we
6896+ * aren't supposed to produce any output anyway.
6897+ */
6898+ diff_free_file (options );
6899+ options -> file = xfopen ("/dev/null" , "w" );
6900+ options -> close_file = 1 ;
6901+ options -> color_moved = 0 ;
68936902 for (i = 0 ; i < q -> nr ; i ++ ) {
68946903 struct diff_filepair * p = q -> queue [i ];
68956904 if (check_pair_status (p ))
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ test_expect_success 'git diff-tree HEAD HEAD' '
5050 test_expect_code 0 git diff-tree --quiet HEAD HEAD >cnt &&
5151 test_line_count = 0 cnt
5252'
53+ test_expect_success ' git diff-tree -w HEAD^ HEAD' '
54+ test_expect_code 1 git diff-tree --quiet -w HEAD^ HEAD >cnt &&
55+ test_line_count = 0 cnt
56+ '
5357test_expect_success ' git diff-files' '
5458 test_expect_code 0 git diff-files --quiet >cnt &&
5559 test_line_count = 0 cnt
You can’t perform that action at this time.
0 commit comments