diff-* --patch-with-raw
[git.git] / combine-diff.c
index 4657eb4..011bb8d 100644 (file)
@@ -151,7 +151,8 @@ static void append_lost(struct sline *sline, int n, const char *line, int len)
 struct combine_diff_state {
        struct xdiff_emit_state xm;
 
-       unsigned int lno, ob, on, nb, nn;
+       unsigned int lno;
+       int ob, on, nb, nn;
        unsigned long nmask;
        int num_parent;
        int n;
@@ -831,6 +832,7 @@ const char *diff_tree_combined_merge(const unsigned char *sha1,
 
        diffopts = *opt;
        diffopts.output_format = DIFF_FORMAT_NO_OUTPUT;
+       diffopts.with_raw = 0;
        diffopts.recursive = 1;
 
        /* count parents */
@@ -857,6 +859,16 @@ const char *diff_tree_combined_merge(const unsigned char *sha1,
                        num_paths++;
        }
        if (num_paths) {
+               if (opt->with_raw) {
+                       int saved_format = opt->output_format;
+                       opt->output_format = DIFF_FORMAT_RAW;
+                       for (p = paths; p; p = p->next) {
+                               if (show_combined_diff(p, num_parent, dense,
+                                                      header, opt))
+                                       header = NULL;
+                       }
+                       opt->output_format = saved_format;
+               }
                for (p = paths; p; p = p->next) {
                        if (show_combined_diff(p, num_parent, dense,
                                               header, opt))