diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-07-22 15:29:54 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-07-22 16:40:42 -0400 |
| commit | 1439b9ff05524949b6b3fa6cad716a9bb3cbc249 (patch) | |
| tree | f415113d2ad056afda7ed9237d6cf9dbd73df72a /include/git2 | |
| parent | 0bd547a8bee02bf984ea5c7acdc8172044fcb3a4 (diff) | |
| download | libgit2-1439b9ff05524949b6b3fa6cad716a9bb3cbc249.tar.gz | |
filter: introduce GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT
Provide a mechanism to filter using attribute data from a specific
commit (making use of `GIT_ATTR_CHECK_INCLUDE_COMMIT`).
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/blob.h | 12 | ||||
| -rw-r--r-- | include/git2/filter.h | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h index 3f6738675..fceb5c771 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -114,6 +114,12 @@ typedef enum { * in the HEAD commit. */ GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD = (1 << 2), + + /** + * When set, filters will be loaded from a `.gitattributes` file + * in the specified commit. + */ + GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT = (1 << 3), } git_blob_filter_flag_t; /** @@ -128,6 +134,12 @@ typedef struct { /** Flags to control the filtering process, see `git_blob_filter_flag_t` above */ uint32_t flags; + + /** + * The commit to load attributes from, when + * `GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT` is specified. + */ + git_oid *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 545815171..044c3b870 100644 --- a/include/git2/filter.h +++ b/include/git2/filter.h @@ -49,6 +49,12 @@ typedef enum { /** Load attributes from `.gitattributes` in the root of HEAD */ GIT_FILTER_ATTRIBUTES_FROM_HEAD = (1u << 2), + + /** + * Load attributes from `.gitattributes` in a given commit. + * This can only be specified in a `git_filter_options`. + */ + GIT_FILTER_ATTRIBUTES_FROM_COMMIT = (1u << 3), } git_filter_flag_t; /** @@ -59,6 +65,12 @@ typedef struct { /** See `git_filter_flag_t` above */ uint32_t flags; + + /** + * The commit to load attributes from, when + * `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified. + */ + git_oid *commit_id; } git_filter_options; #define GIT_FILTER_OPTIONS_VERSION 1 |
