summaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-03-14 18:12:51 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-03-14 23:21:19 (GMT)
commit822cac015589889c1a9e6d49a2c054b7f1b838ba (patch)
tree0ba8c9043054c478ca5ecd210ed752e63d0841fc /tree-diff.c
parent68aacb2f3ceef528ded945b510094918bfe3cb37 (diff)
downloadgit-822cac015589889c1a9e6d49a2c054b7f1b838ba.zip
git-822cac015589889c1a9e6d49a2c054b7f1b838ba.tar.gz
git-822cac015589889c1a9e6d49a2c054b7f1b838ba.tar.bz2
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>
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tree-diff.c b/tree-diff.c
index c827582..44cde74 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;