diff-tree -r -t: include added/removed directories in the output
[gitweb.git] / tree-diff.c
index 9f67af6c1fbb9130962cd373d8e2ebecf543c640..c83a8da39231ef9e12ea695aceef3b2ef60e2600 100644 (file)
@@ -233,6 +233,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);