X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=diff-tree.c;h=8297b7f3a950e66baa5369eb551ab9de453bf13b;hb=fbe082a528861af785be15bb37d1c7d8f574daa4;hp=266528a143af6dfb3ae2e05de6c030872304ff9f;hpb=d0309355c9d0df60836b0610169044873f791caf;p=git.git diff --git a/diff-tree.c b/diff-tree.c index 266528a1..8297b7f3 100644 --- a/diff-tree.c +++ b/diff-tree.c @@ -6,6 +6,7 @@ static int show_root_diff = 0; static int verbose_header = 0; static int ignore_merges = 1; static int recursive = 0; +static int show_tree_entry_in_recursive = 0; static int read_stdin = 0; static int diff_output_format = DIFF_FORMAT_HUMAN; static int detect_rename = 0; @@ -123,6 +124,8 @@ static int compare_tree_entry(void *tree1, unsigned long size1, void *tree2, uns if (recursive && S_ISDIR(mode1)) { int retval; char *newbase = malloc_base(base, path1, pathlen1); + if (show_tree_entry_in_recursive) + diff_change(mode1, mode2, sha1, sha2, base, path1); retval = diff_tree_sha1(sha1, sha2, newbase); free(newbase); return retval; @@ -265,8 +268,6 @@ static int call_diff_flush(void) diff_flush(DIFF_FORMAT_NO_OUTPUT, 0); return 0; } - if (nr_paths) - diffcore_pathspec(paths); if (header) { if (diff_output_format == DIFF_FORMAT_MACHINE) { const char *ep, *cp; @@ -463,7 +464,7 @@ static int diff_tree_stdin(char *line) } static char *diff_tree_usage = -"git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-C] [-R] [-S] [-m] [-s] [-v] "; +"git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-C] [-R] [-S] [-m] [-s] [-v] [-t] "; int main(int argc, const char **argv) { @@ -498,6 +499,10 @@ int main(int argc, const char **argv) recursive = 1; continue; } + if (!strcmp(arg, "-t")) { + recursive = show_tree_entry_in_recursive = 1; + continue; + } if (!strcmp(arg, "-R")) { reverse_diff = 1; continue;