summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 822cac0)
raw | patch | inline | side by side (parent: 822cac0)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Mar 2007 20:12:18 +0000 (13:12 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Mar 2007 23:21:19 +0000 (16:21 -0700) |
This explains how tree_difference variable is used, and updates two
places where the code knows symbolic constant REV_TREE_SAME is 0.
Signed-off-by: Junio C Hamano <junkio@cox.net>
places where the code knows symbolic constant REV_TREE_SAME is 0.
Signed-off-by: Junio C Hamano <junkio@cox.net>
revision.c | patch | blob | history |
diff --git a/revision.c b/revision.c
index 3c2eb125e6e9332fe32be9bcec6fb2005228c211..129d1978e48654959a53d1f39aec480054366f49 100644 (file)
--- a/revision.c
+++ b/revision.c
return 1;
}
+/*
+ * The goal is to get REV_TREE_NEW as the result only if the
+ * diff consists of all '+' (and no other changes), and
+ * REV_TREE_DIFFERENT otherwise (of course if the trees are
+ * the same we want REV_TREE_SAME). That means that once we
+ * get to REV_TREE_DIFFERENT, we do not have to look any further.
+ */
static int tree_difference = REV_TREE_SAME;
static void file_add_remove(struct diff_options *options,
empty.buf = "";
empty.size = 0;
- tree_difference = 0;
+ tree_difference = REV_TREE_SAME;
retval = diff_tree(&empty, &real, "", &revs->pruning);
free(tree);
- return retval >= 0 && !tree_difference;
+ return retval >= 0 && (tree_difference == REV_TREE_SAME);
}
static void try_to_simplify_commit(struct rev_info *revs, struct commit *commit)