]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/diff-exit-code-with-w-fixes' into maint-2.42
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 07:53:15 +0000 (16:53 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 07:53:15 +0000 (16:53 +0900)
"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

1  2 
diff.c
t/t4015-diff-whitespace.sh

diff --cc diff.c
index ee3eb629e3dc5e3010342ed988678d9f0cedd0bd,78f4e7518f8e3ca83d5849b782488441b750d1f3..28ba22947617d8ab23c2da7e65e6ed5c895484f4
--- 1/diff.c
--- 2/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);
  
Simple merge