check-ignore: move setup into cmd_check_ignore()
authorAdam Spiers <git@adamspiers.org>
Thu, 11 Apr 2013 12:05:11 +0000 (13:05 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Apr 2013 18:01:58 +0000 (11:01 -0700)
commit0006d85c3a2fcbd803ed46cf283fab4e4fae3a7f
tree2defa4151a8aa9df407dd0f79dfece06bf02aaa0
parentae3caf4c912429c8e9755f2e10d2f0a7f6279c36
check-ignore: move setup into cmd_check_ignore()

Initialisation of the dir_struct and path_exclude_check structs was
previously done within check_ignore().  This was acceptable since
check_ignore() was only called once per check-ignore invocation;
however the next commit will convert it into an inner loop which is
called once per line of STDIN when --stdin is given.  Therefore moving
the initialisation code out into cmd_check_ignore() ensures that
initialisation is still only performed once per check-ignore
invocation, and consequently that the output is identical whether
pathspecs are provided as CLI arguments or via STDIN.

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