Skip to content

Commit

Permalink
git-diff: turn on recursion by default
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
peff authored and gitster committed Jul 29, 2007
1 parent c22486c commit 82cb8af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion t/t9300-fast-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ EXPECT_END
test_expect_success \
'L: verify internal tree sorting' \
'git-fast-import <input &&
git diff --raw L^ L >output &&
git diff-tree --abbrev --raw L^ L >output &&
git diff expect output'

###
Expand Down

0 comments on commit 82cb8af

Please sign in to comment.