From: Linus Torvalds Date: Mon, 23 May 2005 23:37:47 +0000 (-0700) Subject: diff-tree: don't write headers if the diff queue is empty X-Git-Tag: v0.99~482 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9ab55bd29a9f110810b72d82be912380f74051b3;p=git.git diff-tree: don't write headers if the diff queue is empty This is not a pickaxe-specific thing, we do this regardless of what has pruned down the diff queue. --- diff --git a/diff-tree.c b/diff-tree.c index 0d21b18f..31f80190 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -267,12 +267,12 @@ static int call_diff_flush(void) if (detect_rename) diffcore_rename(detect_rename, diff_score_opt); diffcore_prune(); - if (pickaxe) { + if (pickaxe) diffcore_pickaxe(pickaxe); - if (diff_queue_is_empty()) { - diff_flush(DIFF_FORMAT_NO_OUTPUT, 0); - return 0; - } + + if (diff_queue_is_empty()) { + diff_flush(DIFF_FORMAT_NO_OUTPUT, 0); + return 0; } if (nr_paths) diffcore_pathspec(paths);