From: "Nick Edelen" <sirnot@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH] fix show_entry() in tree-diff.c for TREE_IN_RECURSIVE
Date: Sat, 13 Jun 2009 22:32:33 +0200 [thread overview]
Message-ID: <op.uvhcoii8tdk399@sirnot.private> (raw)
fix show_entry() in tree_diff.c to display tree entries on TREE_IN_RECURSIVE
Signed-off-by: Nick Edelen <sirnot@gmail.com>
---
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);
--
next reply other threads:[~2009-06-13 20:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-13 20:32 Nick Edelen [this message]
2009-06-13 23:42 ` [PATCH] fix show_entry() in tree-diff.c for TREE_IN_RECURSIVE Junio C Hamano
2009-06-14 0:05 ` Junio C Hamano
2009-06-14 12:01 ` Nick Edelen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.uvhcoii8tdk399@sirnot.private \
--to=sirnot@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.