diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-09-21 11:28:39 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-09-21 11:28:39 -0400 |
| commit | 90656858ce6ec0f4cba5ba5f8690ace9b83161d0 (patch) | |
| tree | 8bfb9c6885cc4e6747edad3d361638c6cfc5c2e3 /include | |
| parent | ba01547d4a8190d5e4df317d4b0d0767e160bc57 (diff) | |
| download | libgit2-90656858ce6ec0f4cba5ba5f8690ace9b83161d0.tar.gz | |
filter: use a `git_oid` in filter options, not a pointerethomson/filter_commit_id
Using a `git_oid *` in filter options was a mistake; it is a deviation
from our typical pattern, and callers in some languages that GC may need
very special treatment in order to pass both an options structure and a
pointer outside of it.
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/attr.h | 8 | ||||
| -rw-r--r-- | include/git2/blob.h | 8 | ||||
| -rw-r--r-- | include/git2/filter.h | 8 |
3 files changed, 21 insertions, 3 deletions
diff --git a/include/git2/attr.h b/include/git2/attr.h index 62c2ed6e7..3891a0c97 100644 --- a/include/git2/attr.h +++ b/include/git2/attr.h @@ -147,11 +147,17 @@ typedef struct { /** A combination of GIT_ATTR_CHECK flags */ unsigned int flags; +#ifdef GIT_DEPRECATE_HARD + void *reserved; +#else + git_oid *commit_id; +#endif + /** * The commit to load attributes from, when * `GIT_ATTR_CHECK_INCLUDE_COMMIT` is specified. */ - git_oid *commit_id; + git_oid attr_commit_id; } git_attr_options; #define GIT_ATTR_OPTIONS_VERSION 1 diff --git a/include/git2/blob.h b/include/git2/blob.h index fceb5c771..8fc73919d 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -135,11 +135,17 @@ typedef struct { /** Flags to control the filtering process, see `git_blob_filter_flag_t` above */ uint32_t flags; +#ifdef GIT_DEPRECATE_HARD + void *reserved; +#else + git_oid *commit_id; +#endif + /** * The commit to load attributes from, when * `GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT` is specified. */ - git_oid *commit_id; + git_oid attr_commit_id; } git_blob_filter_options; #define GIT_BLOB_FILTER_OPTIONS_VERSION 1 diff --git a/include/git2/filter.h b/include/git2/filter.h index 044c3b870..0465e5b14 100644 --- a/include/git2/filter.h +++ b/include/git2/filter.h @@ -66,11 +66,17 @@ typedef struct { /** See `git_filter_flag_t` above */ uint32_t flags; +#ifdef GIT_DEPRECATE_HARD + void *reserved; +#else + git_oid *commit_id; +#endif + /** * The commit to load attributes from, when * `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified. */ - git_oid *commit_id; + git_oid attr_commit_id; } git_filter_options; #define GIT_FILTER_OPTIONS_VERSION 1 |
