diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2017-11-21 20:58:47 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-22 14:11:56 +0900 |
commit | 578d81d0c445f714dce46d5f4e3f599ac3a94c75 (patch) | |
tree | d8dbfbc67045d979e728c24df55b577fef77dc99 /dir.h | |
parent | cb5918aa0d50f50e83787f65c2ddc3dcb10159fe (diff) | |
download | git-578d81d0c445f714dce46d5f4e3f599ac3a94c75.tar.gz |
dir: allow exclusions from blob in addition to file
Refactor add_excludes() to separate the reading of the
exclude file into a buffer and the parsing of the buffer
into exclude_list items.
Add add_excludes_from_blob_to_list() to allow an exclude
file be specified with an OID without assuming a local
worktree or index exists.
Refactor read_skip_worktree_file_from_index() and add
do_read_blob() to eliminate duplication of preliminary
processing of blob contents.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.h')
-rw-r--r-- | dir.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -256,6 +256,9 @@ extern struct exclude_list *add_exclude_list(struct dir_struct *dir, extern int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen, struct exclude_list *el, struct index_state *istate); extern void add_excludes_from_file(struct dir_struct *, const char *fname); +extern int add_excludes_from_blob_to_list(struct object_id *oid, + const char *base, int baselen, + struct exclude_list *el); extern void parse_exclude_pattern(const char **string, int *patternlen, unsigned *flags, int *nowildcardlen); extern void add_exclude(const char *string, const char *base, int baselen, struct exclude_list *el, int srcpos); |