diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-01 11:11:49 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-01 11:11:49 -0300 |
commit | 705cd82152b3228cb5162c8e5680b77074bdac91 (patch) | |
tree | e6cc38b36a9c5774b959d6a5b686ac61de87e46a /git.h | |
parent | fb6bcf3f91b0297f218a91cedabfbed875c1b432 (diff) |
git: Add `parse_remote_branch()` callback
This needs to be done in order to properly allocate the remote branch
before setting it's members.
Diffstat (limited to 'git.h')
-rw-r--r-- | git.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -57,6 +57,7 @@ extern pull_request *get_pull_request(index_t *idx, const char *root, const char extern int add_comment(comment *comment, const char *pr_root); extern int create_pull_request_dir(pull_request *pr, index_t *idx, const char *root, const char *repo); +int parse_remote_branch(void *ctx, void *ret, const keyword *key, keyword_val val); int parse_patch_list(void *ctx, void *ret, const keyword *key, keyword_val val); int parse_comment_reply(void *ctx, void *ret, const keyword *key, keyword_val val); @@ -67,8 +68,8 @@ static const keyword *info_keywords[] = { &(const keyword){"date", "Date of Pull Request's creation.", "%a %b %e %H:%M:%S %Y %z", TYPE_TIME, offset_list(offsetof(pull_request, date)), NULL}, &(const keyword){"description", "Description of Pull Request.", NULL, TYPE_STRING, offset_list(offsetof(pull_request, desc)), NULL}, &(const keyword){"type", "Type of Pull Request (0 = patch files, 1 = remote repo).", NULL, TYPE_INT, offset_list(offsetof(pull_request, pr_type)), NULL}, - &(const keyword){"branch", "Branch of remote repo.", NULL, TYPE_STRING, offset_list(offsetof(pull_request, branch), offsetof(git_branch, name)), NULL}, - &(const keyword){"repo", "URL of remote repo.", NULL, TYPE_STRING, offset_list(offsetof(pull_request, branch), offsetof(git_branch, repo)), NULL}, + &(const keyword){"branch", "Branch of remote repo.", NULL, TYPE_STRING, offset_list(offsetof(pull_request, branch), offsetof(git_branch, name)), parse_remote_branch}, + &(const keyword){"repo", "URL of remote repo.", NULL, TYPE_STRING, offset_list(offsetof(pull_request, branch), offsetof(git_branch, repo)), parse_remote_branch}, &(const keyword){"patches", "Patch file(s) of Pull Request.", NULL, TYPE_STRING, offset_list(offsetof(pull_request, patches), offsetof(file, name)), parse_patch_list}, NULL, }; |