From: Jakub Narebski Date: Sat, 28 Apr 2018 17:54:48 GMT Subject: Re: [PATCH v4 01/10] ref-filter: fix outdated comment on in_commit_list Message-ID: <86d0yjjjx3.fsf@gmail.com> In-Reply-To: <20180425143735.240183-2-dstolee@microsoft.com> Derrick Stolee writes: > The in_commit_list() method does not check the parents of > the candidate for containment in the list. Fix the comment > that incorrectly states that it does. > > Reported-by: Jakub Narebski > Signed-off-by: Derrick Stolee > --- > ref-filter.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ref-filter.c b/ref-filter.c > index cffd8bf3ce..aff24d93be 100644 > --- a/ref-filter.c > +++ b/ref-filter.c > @@ -1582,7 +1582,7 @@ static int in_commit_list(const struct commit_list *want, struct commit *c) > } > > /* > - * Test whether the candidate or one of its parents is contained in the list. > + * Test whether the candidate is contained in the list. > * Do not recurse to find out, though, but return -1 if inconclusive. > */ > static enum contains_result contains_test(struct commit *candidate, All right. Always good to have comment and code match. FYI: the contains_test() function described in this comment only checks the candidate, and never access candidate commit parents. All recursion, which naturally includes checking parents, is in the contains_tag_algo(). I guess that the code was refactored, but comment had not been changed. -- Jakub Narębski