Merge branch 'pb/regex'
authorJunio C Hamano <junkio@cox.net>
Wed, 5 Apr 2006 21:06:26 +0000 (14:06 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 5 Apr 2006 21:06:26 +0000 (14:06 -0700)
* pb/regex:
On some platforms, certain headers need to be included before regex.h
Support for pickaxe matching regular expressions

1  2 
diff.c
diff --combined diff.c
index fe4664c53cbfb6cfc6c2132bced61fddc262a6ee,2db2cc568dae9e94f56343cb1c900a2da195c9d0..ce98a90805f881fa9ef161448af22e859db0d93d
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -883,6 -883,8 +883,8 @@@ int diff_opt_parse(struct diff_options 
                options->filter = arg + 14;
        else if (!strcmp(arg, "--pickaxe-all"))
                options->pickaxe_opts = DIFF_PICKAXE_ALL;
+       else if (!strcmp(arg, "--pickaxe-regex"))
+               options->pickaxe_opts = DIFF_PICKAXE_REGEX;
        else if (!strncmp(arg, "-B", 2)) {
                if ((options->break_opt =
                     diff_scoreopt_parse(arg)) == -1)
@@@ -1280,34 -1282,28 +1282,34 @@@ void diff_flush(struct diff_options *op
  
        for (i = 0; i < q->nr; i++) {
                struct diff_filepair *p = q->queue[i];
 -              if ((diff_output_format == DIFF_FORMAT_NO_OUTPUT) ||
 -                  (p->status == DIFF_STATUS_UNKNOWN))
 -                      continue;
 -              if (p->status == 0)
 -                      die("internal error in diff-resolve-rename-copy");
 -              switch (diff_output_format) {
 -              case DIFF_FORMAT_PATCH:
 -                      diff_flush_patch(p, options);
 -                      break;
 -              case DIFF_FORMAT_RAW:
 -              case DIFF_FORMAT_NAME_STATUS:
 -                      diff_flush_raw(p, line_termination,
 -                                     inter_name_termination,
 -                                     options);
 +
 +              switch (p->status) {
 +              case DIFF_STATUS_UNKNOWN:
                        break;
 -              case DIFF_FORMAT_NAME:
 -                      diff_flush_name(p,
 -                                      inter_name_termination,
 -                                      line_termination);
 +              case 0:
 +                      die("internal error in diff-resolve-rename-copy");
                        break;
 +              default:
 +                      switch (diff_output_format) {
 +                      case DIFF_FORMAT_PATCH:
 +                              diff_flush_patch(p, options);
 +                              break;
 +                      case DIFF_FORMAT_RAW:
 +                      case DIFF_FORMAT_NAME_STATUS:
 +                              diff_flush_raw(p, line_termination,
 +                                             inter_name_termination,
 +                                             options);
 +                              break;
 +                      case DIFF_FORMAT_NAME:
 +                              diff_flush_name(p,
 +                                              inter_name_termination,
 +                                              line_termination);
 +                              break;
 +                      case DIFF_FORMAT_NO_OUTPUT:
 +                              break;
 +                      }
                }
 -              diff_free_filepair(q->queue[i]);
 +              diff_free_filepair(p);
        }
        free(q->queue);
        q->queue = NULL;