Merge branch 'jc/numstat'
authorJunio C Hamano <junkio@cox.net>
Wed, 13 Dec 2006 19:00:32 +0000 (11:00 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 13 Dec 2006 19:00:32 +0000 (11:00 -0800)
* jc/numstat:
diff --numstat: show binary with '-' to match "apply --numstat"

1  2 
diff.c
diff --combined diff.c
index 726b01e75e9b9fb7c5e161eb466a1aea335a25c3,d6d17f47346a6af88bc25cbebfa029d445b8f672..2df14b2469362bfd8a30a45457953d993baae66d
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -60,7 -60,7 +60,7 @@@ int git_diff_ui_config(const char *var
                diff_rename_limit_default = git_config_int(var, value);
                return 0;
        }
 -      if (!strcmp(var, "diff.color")) {
 +      if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
                diff_use_color_default = git_config_colorbool(var, value);
                return 0;
        }
@@@ -74,7 -74,7 +74,7 @@@
                        diff_detect_rename_default = DIFF_DETECT_RENAME;
                return 0;
        }
 -      if (!strncmp(var, "diff.color.", 11)) {
 +      if (!strncmp(var, "diff.color.", 11) || !strncmp(var, "color.diff.", 11)) {
                int slot = parse_diff_color_slot(var, 11);
                color_parse(value, var, diff_colors[slot]);
                return 0;
@@@ -802,7 -802,10 +802,10 @@@ static void show_numstat(struct diffsta
        for (i = 0; i < data->nr; i++) {
                struct diffstat_file *file = data->files[i];
  
-               printf("%d\t%d\t", file->added, file->deleted);
+               if (file->is_binary)
+                       printf("-\t-\t");
+               else
+                       printf("%d\t%d\t", file->added, file->deleted);
                if (options->line_termination &&
                    quote_c_style(file->name, NULL, NULL, 0))
                        quote_c_style(file->name, NULL, stdout, 0);