From: Jeff King Date: Sun, 29 Jul 2007 09:49:56 +0000 (-0400) Subject: git-diff: turn on recursion by default X-Git-Tag: v1.5.3-rc4~44 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=82cb8afa9bf24d2f77a6d565cdc08d6aa1febeb4;p=git.git git-diff: turn on recursion by default The tree recursion behavior of git-diff may appear inconsistent to the user because it depends on the format of the patch as well as whether one is diffing between trees or against the index. Since git-diff is a porcelain wrapper for low-level diff commands, it makes sense for its behavior to be consistent no matter what is being diffed. This patch turns on recursion in all cases. Signed-off-by: Junio C Hamano --- diff --git a/builtin-diff.c b/builtin-diff.c index 7f367b6b9..b48121e6e 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -233,6 +233,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) die("diff_setup_done failed"); } rev.diffopt.allow_external = 1; + rev.diffopt.recursive = 1; /* Do we have --cached and not have a pending object, then * default to HEAD by hand. Eek. diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 4b920be33..6f95305bf 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -577,7 +577,7 @@ EXPECT_END test_expect_success \ 'L: verify internal tree sorting' \ 'git-fast-import output && + git diff-tree --abbrev --raw L^ L >output && git diff expect output' ###