diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-06 12:13:28 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-06 12:13:28 -0300 |
commit | fbe98f57dc779069bd283ac1773866ce73727ea0 (patch) | |
tree | f5091e55374f4bf91ae011cf856519bc829327de /git.c | |
parent | a185caea7fbc0969829b96af3f43e8ae980df000 (diff) |
git: Add `get_pr_type()` keyword getter callback
This callback is needed because `pr_type` is a `uint8_t`, but the
keyword type is `TYPE_INT` which assumes that the type is an `int`.
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -377,6 +377,16 @@ pull_request *get_pull_request(index_t *idx, const char *root, const char *repo) } } +int get_pr_type(void *ctx, void *data, const keyword *key, keyword_val *val) { + pull_request *pr = (pull_request *)data; + if (key->type == TYPE_INT && pr != NULL) { + val->i = pr->pr_type; + return 1; + } else { + return -1; + } +} + int has_remote_branch(void *ctx, void *data, const keyword *key, keyword_val *val) { pull_request *pr = (pull_request *)data; return (pr->pr_type) ? 0 : -1; |