Code

Merge branch 'ar/diff'
authorJunio C Hamano <junkio@cox.net>
Sun, 18 Mar 2007 22:48:06 +0000 (15:48 -0700)
committerJunio C Hamano <junkio@cox.net>
Sun, 18 Mar 2007 22:48:06 +0000 (15:48 -0700)
* ar/diff:
  Add tests for --quiet option of diff programs
  try-to-simplify-commit: use diff-tree --quiet machinery.
  revision.c: explain what tree_difference does
  Teach --quiet to diff backends.
  diff --quiet
  Remove unused diffcore_std_no_resolve
  Allow git-diff exit with codes similar to diff(1)

1  2 
tree-diff.c

diff --cc tree-diff.c
index f89b9d31e4542724ff44b6f3c3bc6ae3adcaa1a6,44cde74caf20ded9cd196c4e5d16f4d9ba251a22..3940962e79a5094e61270cd951d5d37c307d11a9
@@@ -160,10 -160,10 +160,12 @@@ static void show_entry(struct diff_opti
  
  int diff_tree(struct tree_desc *t1, struct tree_desc *t2, const char *base, struct diff_options *opt)
  {
 +      int baselen = strlen(base);
 +
        while (t1->size | t2->size) {
 -              if (opt->nr_paths && t1->size && !interesting(t1, base, opt)) {
+               if (opt->quiet && opt->has_changes)
+                       break;
 +              if (opt->nr_paths && t1->size && !interesting(t1, base, baselen, opt)) {
                        update_tree_entry(t1);
                        continue;
                }