Teach --quiet to diff backends.

This teaches git-diff-files, git-diff-index and git-diff-tree
backends to exit early under --quiet option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2007-03-14 11:12:51 -07:00
parent 68aacb2f3c
commit 822cac0155
2 changed files with 8 additions and 0 deletions

View File

@ -161,6 +161,8 @@ static void show_entry(struct diff_options *opt, const char *prefix, struct tree
int diff_tree(struct tree_desc *t1, struct tree_desc *t2, const char *base, struct diff_options *opt)
{
while (t1->size | t2->size) {
if (opt->quiet && opt->has_changes)
break;
if (opt->nr_paths && t1->size && !interesting(t1, base, opt)) {
update_tree_entry(t1);
continue;