From 570ba25cb0f757f993e06df629faced32fdf2f8f Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 30 Aug 2013 16:02:07 -0700 Subject: Make git_filter_source opaque --- include/git2/sys/filter.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'include/git2/sys') diff --git a/include/git2/sys/filter.h b/include/git2/sys/filter.h index 2264be080..b1193a538 100644 --- a/include/git2/sys/filter.h +++ b/include/git2/sys/filter.h @@ -22,12 +22,29 @@ GIT_BEGIN_DECL * A filter source represents a file/blob to be processed */ typedef struct git_filter_source git_filter_source; -struct git_filter_source { - git_repository *repo; - const char *path; - git_oid oid; /* zero if unknown (which is likely) */ - uint16_t filemode; /* zero if unknown */ -}; + +/** + * Get the repository that the source data is coming from. + */ +GIT_EXTERN(git_repository *) git_filter_source_repo(const git_filter_source *src); + +/** + * Get the path that the source data is coming from. + */ +GIT_EXTERN(const char *) git_filter_source_path(const git_filter_source *src); + +/** + * Get the file mode of the source file + * If the mode is unknown, this will return 0 + */ +GIT_EXTERN(uint16_t) git_filter_source_filemode(const git_filter_source *src); + +/** + * Get the OID of the source + * If the OID is unknown (often the case with GIT_FILTER_CLEAN) then + * this will return NULL. + */ +GIT_EXTERN(const git_oid *) git_filter_source_id(const git_filter_source *src); /** * Callback to actually perform the data filtering -- cgit v1.2.1