Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-19 01:07:42 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-19 01:07:42 +0400
commited1a368ba137898bf012dbb8cda0a4cac89d64da (patch)
tree1a808214cd5f1f3199127c4928dad0a8447013af /diff-tree.c
parentcb6c8ed2fea4515ee876c40a2bbd5541e24fc12b (diff)
diff-tree: fix "whole sub-tree disappeared or appeared" case
We still need to check which part of the sub-tree is interesting.
Diffstat (limited to 'diff-tree.c')
-rw-r--r--diff-tree.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/diff-tree.c b/diff-tree.c
index 3bc7480944..8fb5729363 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -54,15 +54,7 @@ static char *malloc_base(const char *base, const char *path, int pathlen)
}
static void show_file(const char *prefix, void *tree, unsigned long size, const char *base);
-
-/* A whole sub-tree went away or appeared */
-static void show_tree(const char *prefix, void *tree, unsigned long size, const char *base)
-{
- while (size) {
- show_file(prefix, tree, size, base);
- update_tree_entry(&tree, &size);
- }
-}
+static void show_tree(const char *prefix, void *tree, unsigned long size, const char *base);
/* A file entry went away or appeared */
static void show_file(const char *prefix, void *tree, unsigned long size, const char *base)
@@ -222,6 +214,16 @@ static int interesting(void *tree, unsigned long size, const char *base)
return 0; /* No matches */
}
+/* A whole sub-tree went away or appeared */
+static void show_tree(const char *prefix, void *tree, unsigned long size, const char *base)
+{
+ while (size) {
+ if (interesting(tree, size, base))
+ show_file(prefix, tree, size, base);
+ update_tree_entry(&tree, &size);
+ }
+}
+
static int diff_tree(void *tree1, unsigned long size1, void *tree2, unsigned long size2, const char *base)
{
while (size1 | size2) {