Skip to content

Commit b6b987a

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d599e04 commit b6b987a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tree-diff.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const
8585
/*
8686
* Is a tree entry interesting given the pathspec we have?
8787
*
88+
* Pre-condition: baselen == 0 || base[baselen-1] == '/'
89+
*
8890
* Return:
8991
* - 2 for "yes, and all subsequent entries will be"
9092
* - 1 for yes

0 commit comments

Comments
 (0)