Merge branch 'nd/maint-diffstat-summary' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 20 Sep 2012 22:55:31 +0000 (15:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Sep 2012 22:55:31 +0000 (15:55 -0700)
* nd/maint-diffstat-summary:
Revert diffstat back to English

1  2 
diff.c
diff --combined diff.c
index e6846ca7507aa8a423c5e1f89390fa37723248ff,1d9783c951218fa3da82e40dce1fe8dd00dce4b1..32142dba64e0a6e926101c38b6efd95d21e0dc82
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -574,7 -574,6 +574,7 @@@ static void emit_rewrite_lines(struct e
        if (!endp) {
                const char *plain = diff_get_color(ecb->color_diff,
                                                   DIFF_PLAIN);
 +              putc('\n', ecb->opt->file);
                emit_line_0(ecb->opt, plain, reset, '\\',
                            nneof, strlen(nneof));
        }
@@@ -1398,11 -1397,11 +1398,11 @@@ int print_stat_summary(FILE *fp, int fi
  
        if (!files) {
                assert(insertions == 0 && deletions == 0);
-               return fprintf(fp, "%s\n", _(" 0 files changed"));
+               return fprintf(fp, "%s\n", " 0 files changed");
        }
  
        strbuf_addf(&sb,
-                   Q_(" %d file changed", " %d files changed", files),
+                   (files == 1) ? " %d file changed" : " %d files changed",
                    files);
  
        /*
                 * do not translate it.
                 */
                strbuf_addf(&sb,
-                           Q_(", %d insertion(+)", ", %d insertions(+)",
-                              insertions),
+                           (insertions == 1) ? ", %d insertion(+)" : ", %d insertions(+)",
                            insertions);
        }
  
                 * do not translate it.
                 */
                strbuf_addf(&sb,
-                           Q_(", %d deletion(-)", ", %d deletions(-)",
-                              deletions),
+                           (deletions == 1) ? ", %d deletion(-)" : ", %d deletions(-)",
                            deletions);
        }
        strbuf_addch(&sb, '\n');
@@@ -2542,12 -2539,12 +2540,12 @@@ void free_filespec(struct diff_filespe
  }
  
  void fill_filespec(struct diff_filespec *spec, const unsigned char *sha1,
 -                 unsigned short mode)
 +                 int sha1_valid, unsigned short mode)
  {
        if (mode) {
                spec->mode = canon_mode(mode);
                hashcpy(spec->sha1, sha1);
 -              spec->sha1_valid = !is_null_sha1(sha1);
 +              spec->sha1_valid = sha1_valid;
        }
  }
  
@@@ -3188,7 -3185,7 +3186,7 @@@ void diff_setup(struct diff_options *op
        }
  }
  
 -int diff_setup_done(struct diff_options *options)
 +void diff_setup_done(struct diff_options *options)
  {
        int count = 0;
  
                options->output_format = DIFF_FORMAT_NO_OUTPUT;
                DIFF_OPT_SET(options, EXIT_WITH_STATUS);
        }
 -
 -      return 0;
  }
  
  static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
@@@ -4692,7 -4691,6 +4690,7 @@@ static int is_submodule_ignored(const c
  void diff_addremove(struct diff_options *options,
                    int addremove, unsigned mode,
                    const unsigned char *sha1,
 +                  int sha1_valid,
                    const char *concatpath, unsigned dirty_submodule)
  {
        struct diff_filespec *one, *two;
        two = alloc_filespec(concatpath);
  
        if (addremove != '+')
 -              fill_filespec(one, sha1, mode);
 +              fill_filespec(one, sha1, sha1_valid, mode);
        if (addremove != '-') {
 -              fill_filespec(two, sha1, mode);
 +              fill_filespec(two, sha1, sha1_valid, mode);
                two->dirty_submodule = dirty_submodule;
        }
  
@@@ -4739,7 -4737,6 +4737,7 @@@ void diff_change(struct diff_options *o
                 unsigned old_mode, unsigned new_mode,
                 const unsigned char *old_sha1,
                 const unsigned char *new_sha1,
 +               int old_sha1_valid, int new_sha1_valid,
                 const char *concatpath,
                 unsigned old_dirty_submodule, unsigned new_dirty_submodule)
  {
                const unsigned char *tmp_c;
                tmp = old_mode; old_mode = new_mode; new_mode = tmp;
                tmp_c = old_sha1; old_sha1 = new_sha1; new_sha1 = tmp_c;
 +              tmp = old_sha1_valid; old_sha1_valid = new_sha1_valid;
 +                      new_sha1_valid = tmp;
                tmp = old_dirty_submodule; old_dirty_submodule = new_dirty_submodule;
                        new_dirty_submodule = tmp;
        }
  
        one = alloc_filespec(concatpath);
        two = alloc_filespec(concatpath);
 -      fill_filespec(one, old_sha1, old_mode);
 -      fill_filespec(two, new_sha1, new_mode);
 +      fill_filespec(one, old_sha1, old_sha1_valid, old_mode);
 +      fill_filespec(two, new_sha1, new_sha1_valid, new_mode);
        one->dirty_submodule = old_dirty_submodule;
        two->dirty_submodule = new_dirty_submodule;