dir.c: refactor is_excluded_from_list()
commit578cd7c3eae11e552bbc34b29f35e273a455988e
authorAdam Spiers <git@adamspiers.org>
Thu, 27 Dec 2012 02:32:26 +0000 (27 02:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Dec 2012 20:07:46 +0000 (28 12:07 -0800)
tree0851fce8f7620084240b66d31b40f9383432b421
parent6d24e7a807922a5fbf1aa4d42f66e4f0a0aaa141
dir.c: refactor is_excluded_from_list()

The excluded function uses a new helper function called
last_exclude_matching_from_list() to perform the inner loop over all of
the exclude patterns.  The helper just tells us whether the path is
included, excluded, or undecided.

However, it may be useful to know _which_ pattern was triggered.  So
let's pass out the entire exclude match, which contains the status
information we were already passing out.

Further patches can make use of this.

This is a modified forward port of a patch from 2009 by Jeff King:
http://article.gmane.org/gmane.comp.version-control.git/108815

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c