@matheusbsbs / matheus-bagliano / commits / 82cb8afa9b
Fork 0

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 <gitster@pobox.com>

Jeff King committed Jul 29, 2007 at 05:49 UTC 82cb8afa9bf24d2f77a6d565cdc08d6aa1febeb4
2 files changed +2 -1
builtin-diff.c
+1
@@ -233,6 +233,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
233 die("diff_setup_done failed");
234 }
235 rev.diffopt.allow_external = 1;
236 + rev.diffopt.recursive = 1;
237
238 /* Do we have --cached and not have a pending object, then
239 * default to HEAD by hand. Eek.
t/t9300-fast-import.sh
+1 -1
@@ -577,7 +577,7 @@ EXPECT_END
577 test_expect_success \
578 'L: verify internal tree sorting' \
579 'git-fast-import <input &&
580 - git diff --raw L^ L >output &&
580 + git diff-tree --abbrev --raw L^ L >output &&
581 git diff expect output'
582
583 ###