From: Junio C Hamano Date: Mon, 28 Feb 2011 05:58:30 +0000 (-0800) Subject: Merge branch 'nd/hash-object-sanity' X-Git-Tag: v1.7.5-rc0~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc7ae9c156775cc9679c0bcc7156abb7dba1bd3a;p=thirdparty%2Fgit.git Merge branch 'nd/hash-object-sanity' * nd/hash-object-sanity: Make hash-object more robust against malformed objects Conflicts: cache.h --- fc7ae9c156775cc9679c0bcc7156abb7dba1bd3a diff --cc cache.h index 677994a23a,9186a56be7..5cc2f896dc --- a/cache.h +++ b/cache.h @@@ -500,23 -500,8 +500,23 @@@ extern int index_name_is_other(const st extern int ie_match_stat(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); -extern int ce_path_match(const struct cache_entry *ce, const char **pathspec); +struct pathspec { + const char **raw; /* get_pathspec() result, not freed by free_pathspec() */ + int nr; + int has_wildcard:1; + int recursive:1; + int max_depth; + struct pathspec_item { + const char *match; + int len; + int has_wildcard:1; + } *items; +}; + +extern int init_pathspec(struct pathspec *, const char **); +extern void free_pathspec(struct pathspec *); +extern int ce_path_match(const struct cache_entry *ce, const struct pathspec *pathspec); - extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path); + extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path, int format_check); extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object); extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);