Skip to content

Commit

Permalink
Document pre-condition for tree_entry_interesting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Elijah Newren authored and Junio C Hamano committed Aug 26, 2010
1 parent d599e04 commit b6b987a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tree-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const
/*
* Is a tree entry interesting given the pathspec we have?
*
* Pre-condition: baselen == 0 || base[baselen-1] == '/'
*
* Return:
* - 2 for "yes, and all subsequent entries will be"
* - 1 for yes
Expand Down

0 comments on commit b6b987a

Please sign in to comment.