Merge branch 'jc/maint-diff-quiet' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2008 02:53:12 +0000 (19:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2008 02:53:12 +0000 (19:53 -0700)
* jc/maint-diff-quiet:
diff --quiet: make it synonym to --exit-code >/dev/null
diff Porcelain: do not disable auto index refreshing on -C -C

1  2 
diff.c
diff --combined diff.c
index 5e01b2bb27994091a0a6ec564b6e3f6a6a0f4ab5,13be211568503ab0927871136f720ce1bddfa6bd..9385a36f1efb1f52250dfa42dbf994f5fd03856d
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -511,20 -511,13 +511,20 @@@ const char *diff_get_color(int diff_use
  
  static void emit_line(FILE *file, const char *set, const char *reset, const char *line, int len)
  {
 -      int has_trailing_newline = (len > 0 && line[len-1] == '\n');
 +      int has_trailing_newline, has_trailing_carriage_return;
 +
 +      has_trailing_newline = (len > 0 && line[len-1] == '\n');
        if (has_trailing_newline)
                len--;
 +      has_trailing_carriage_return = (len > 0 && line[len-1] == '\r');
 +      if (has_trailing_carriage_return)
 +              len--;
  
        fputs(set, file);
        fwrite(line, len, 1, file);
        fputs(reset, file);
 +      if (has_trailing_carriage_return)
 +              fputc('\r', file);
        if (has_trailing_newline)
                fputc('\n', file);
  }
@@@ -2400,13 -2393,6 +2400,6 @@@ int diff_setup_done(struct diff_option
                DIFF_OPT_SET(options, EXIT_WITH_STATUS);
        }
  
-       /*
-        * If we postprocess in diffcore, we cannot simply return
-        * upon the first hit.  We need to run diff as usual.
-        */
-       if (options->pickaxe || options->filter)
-               DIFF_OPT_CLR(options, QUIET);
        return 0;
  }
  
@@@ -3398,10 -3384,7 +3391,7 @@@ static void diffcore_skip_stat_unmatch(
  
  void diffcore_std(struct diff_options *options)
  {
-       if (DIFF_OPT_TST(options, QUIET))
-               return;
-       if (options->skip_stat_unmatch && !DIFF_OPT_TST(options, FIND_COPIES_HARDER))
+       if (options->skip_stat_unmatch)
                diffcore_skip_stat_unmatch(options);
        if (options->break_opt != -1)
                diffcore_break(options->break_opt);