Merge branch 'jc/numstat'
authorJunio C Hamano <junkio@cox.net>
Fri, 24 Nov 2006 11:46:40 +0000 (03:46 -0800)
committerJunio C Hamano <junkio@cox.net>
Fri, 24 Nov 2006 11:46:40 +0000 (03:46 -0800)
* jc/numstat:
apply --numstat: mark binary diffstat with - -, not 0 0

1  2 
builtin-apply.c
diff --combined builtin-apply.c
index 61f047fd45383ac64f27bef88e41b56efefdea3b,b80ad2ce2e5daa0ff6f707154e839c3f09136883..436d9e188070df0e4a51186716b033658a8672b5
@@@ -140,15 -140,12 +140,15 @@@ struct fragment 
  struct patch {
        char *new_name, *old_name, *def_name;
        unsigned int old_mode, new_mode;
 -      int is_rename, is_copy, is_new, is_delete, is_binary;
 +      int is_new, is_delete;  /* -1 = unknown, 0 = false, 1 = true */
        int rejected;
        unsigned long deflate_origlen;
        int lines_added, lines_deleted;
        int score;
 -      int inaccurate_eof:1;
 +      unsigned int inaccurate_eof:1;
 +      unsigned int is_binary:1;
 +      unsigned int is_copy:1;
 +      unsigned int is_rename:1;
        struct fragment *fragments;
        char *result;
        unsigned long resultsize;
@@@ -2119,7 -2116,11 +2119,11 @@@ static void numstat_patch_list(struct p
        for ( ; patch; patch = patch->next) {
                const char *name;
                name = patch->new_name ? patch->new_name : patch->old_name;
-               printf("%d\t%d\t", patch->lines_added, patch->lines_deleted);
+               if (patch->is_binary)
+                       printf("-\t-\t");
+               else
+                       printf("%d\t%d\t",
+                              patch->lines_added, patch->lines_deleted);
                if (line_termination && quote_c_style(name, NULL, NULL, 0))
                        quote_c_style(name, NULL, stdout, 0);
                else