Code

Merge branch 'jk/diffstat-binary'
authorJunio C Hamano <gitster@pobox.com>
Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)
* jk/diffstat-binary:
  diff: don't retrieve binary blobs for diffstat
  diff: handle diffstat of rewritten binary files

1  2 
diff.c

diff --cc diff.c
index 5422c438826254f36d1e00af0e8b882690661276,0d2ed00dad9879ef9209495f78930e0a066452fb..66408571abf91d6b90cd69d04164eafd633e407a
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -2097,15 -1838,18 +2106,17 @@@ static void builtin_diffstat(const cha
                /* Crazy xdl interfaces.. */
                xpparam_t xpp;
                xdemitconf_t xecfg;
 -              xdemitcb_t ecb;
  
+               if (fill_mmfile(&mf1, one) < 0 || fill_mmfile(&mf2, two) < 0)
+                       die("unable to read files to diff");
                memset(&xpp, 0, sizeof(xpp));
                memset(&xecfg, 0, sizeof(xecfg));
 -              xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
 +              xpp.flags = o->xdl_opts;
                xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
 -                            &xpp, &xecfg, &ecb);
 +                            &xpp, &xecfg);
        }
  
-  free_and_return:
        diff_free_filespec_data(one);
        diff_free_filespec_data(two);
  }