Merge branch 'jk/diffstat-binary' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)
* 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 2f2ab87d96324df35cb56c07d8c416f029ba9f56,0d2ed00dad9879ef9209495f78930e0a066452fb..3fd9e0c70315727f835f39d9a0230ee9f24e7ea8
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -2095,15 -1838,18 +2104,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);
  }