[PATCH] fix show_entry() in tree-diff.c for TREE_IN_RECURSIVE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fix show_entry() in tree_diff.c to display tree entries on TREE_IN_RECURSIVE

Signed-off-by: Nick Edelen <sirnot@xxxxxxxxx>

---
this seems like how it should act: trees are shown under this option for changes, so it's logical they should also be shown for adds and removals.  at any rate rev-cache needs it, so I sure hope it's supposed to do this...
 tree-diff.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tree-diff.c b/tree-diff.c
index edd8394..189a298 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -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[0], mode, sha1, newbase);
+			newbase[baselen + pathlen] = '/';
+		}
+
 		init_tree_desc(&inner, tree, size);
 		show_tree(opt, prefix, &inner, newbase, baselen + 1 + pathlen);
 
-- 

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]