Merge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory'

* ne/maint-1.6.0-diff-tree-t-r-show-directory:
  diff-tree -r -t: include added/removed directories in the output
This commit is contained in:
Junio C Hamano
2009-07-01 19:40:47 -07:00
2 changed files with 59 additions and 0 deletions

View File

@ -239,6 +239,12 @@ static void show_entry(struct diff_options *opt, const char *prefix, struct tree
if (!tree || type != OBJ_TREE)
die("corrupt tree sha %s", sha1_to_hex(sha1));
if (DIFF_OPT_TST(opt, TREE_IN_RECURSIVE)) {
newbase[baselen + pathlen] = 0;
opt->add_remove(opt, *prefix, mode, sha1, newbase);
newbase[baselen + pathlen] = '/';
}
init_tree_desc(&inner, tree, size);
show_tree(opt, prefix, &inner, newbase, baselen + 1 + pathlen);