From: Junio C Hamano Date: Thu, 2 Nov 2023 07:53:15 +0000 (+0900) Subject: Merge branch 'jc/diff-exit-code-with-w-fixes' into maint-2.42 X-Git-Tag: v2.42.1~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87644914638e7090334bb123a706fca6840f5763;p=thirdparty%2Fgit.git Merge branch 'jc/diff-exit-code-with-w-fixes' into maint-2.42 "git diff -w --exit-code" with various options did not work correctly, which is being addressed. * jc/diff-exit-code-with-w-fixes: diff: the -w option breaks --exit-code for --raw and other output modes t4040: remove test that succeeded for a wrong reason diff: teach "--stat -w --exit-code" to notice differences diff: mode-only change should be noticed by "--patch -w --exit-code" diff: move the fallback "--exit-code" code down --- 87644914638e7090334bb123a706fca6840f5763 diff --cc diff.c index ee3eb629e3,78f4e7518f..28ba229476 --- a/diff.c +++ b/diff.c @@@ -6705,23 -6596,10 +6729,8 @@@ void diff_flush(struct diff_options *op } } - if (output_format & DIFF_FORMAT_PATCH) { - if (separator) { - emit_diff_symbol(options, DIFF_SYMBOL_SEPARATOR, NULL, 0, 0); - if (options->stat_sep) - /* attach patch instead of inline */ - emit_diff_symbol(options, DIFF_SYMBOL_STAT_SEP, - NULL, 0, 0); - } - - diff_flush_patch_all_file_pairs(options); - } - - if (output_format & DIFF_FORMAT_CALLBACK) - options->format_callback(q, options, options->format_callback_data); - - for (i = 0; i < q->nr; i++) - diff_free_filepair(q->queue[i]); free_queue: - free(q->queue); + diff_free_queue(q); DIFF_QUEUE_CLEAR(q); diff_free(options);