From 822cac015589889c1a9e6d49a2c054b7f1b838ba Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 14 Mar 2007 11:12:51 -0700 Subject: 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 --- tree-diff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tree-diff.c') diff --git a/tree-diff.c b/tree-diff.c index c8275823d0..44cde74caf 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -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; -- cgit v1.2.1