add.c: move pathspec matchers into new pathspec.c for reuse

Extract the following functions from builtin/add.c to pathspec.c, in
preparation for reuse by a new git check-ignore command:

  - fill_pathspec_matches()
  - find_used_pathspec()

The functions being extracted are not changed in any way, except
removal of the 'static' qualifier.

Also add comments documenting these newly public functions,
including clarifications that they operate on the index.

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Adam Spiers
2013-01-06 16:58:08 +00:00
committed by Junio C Hamano
parent f8a1113b47
commit 6f525e7100
4 changed files with 67 additions and 33 deletions

7
pathspec.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef PATHSPEC_H
#define PATHSPEC_H
extern char *find_used_pathspec(const char **pathspec);
extern void fill_pathspec_matches(const char **pathspec, char *seen, int specs);
#endif /* PATHSPEC_H */