check-ignore: fix mix of directories and other file types
commitd60771e93046e9e11183c6ff1fcafd334f8c0453
authorRené Scharfe <l.s.r@web.de>
Sat, 10 Feb 2018 12:38:29 +0000 (10 13:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Feb 2018 21:09:35 +0000 (12 13:09 -0800)
treeb104f07d171ab35990d422e29534e2a5e6d67bb3
parentfc849d8d6b90e5c1e0c37bc0d60dd92b2fe7347f
check-ignore: fix mix of directories and other file types

In check_ignore(), the first pathspec item determines the dtype for any
subsequent ones.  That means that a pathspec matching a regular file can
prevent following pathspecs from matching directories, which makes no
sense.  Fix that by determining the dtype for each pathspec separately,
by passing the value DT_UNKNOWN to last_exclude_matching() each time.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/check-ignore.c
t/t0008-ignores.sh