@matheusbsbs / matheus-bagliano / commits / b6b987a094
Fork 0

Document pre-condition for tree_entry_interesting

tree_entry_interesting will fail to find appropriate matches if the base directory path is not terminated with a slash. Knowing this earlier would have saved me some debugging time. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Aug 26, 2010 at 00:21 UTC b6b987a09457e9c8d49aad9170df32b1f607c5b9
1 file changed +2
tree-diff.c
+2
@@ -85,6 +85,8 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const
85 /*
86 * Is a tree entry interesting given the pathspec we have?
87 *
88 + * Pre-condition: baselen == 0 || base[baselen-1] == '/'
89 + *
90 * Return:
91 * - 2 for "yes, and all subsequent entries will be"
92 * - 1 for yes