diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-07-30 11:29:50 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-10 14:13:44 -0300 |
commit | c62604d54a765273f34396e81ef3130dd21562a9 (patch) | |
tree | 4f469e37090d3bb096cf64849ad4cf10c2e117ca | |
parent | 522ee790ae8a37064bbf830e25bfea8628cae1df (diff) |
dev: Add some more test code
-rw-r--r-- | pullreqd.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -160,6 +160,12 @@ int *init_socket(config *cfg) { int main_loop(config *cfg, int *listen_sockets, git_repo **repos) { int done = 0; struct stat st; + + index_t *idx = &(index_t) { + .type = 1, + .num = 0, + .next = NULL, + }; file **patches = (file *[]) { &(file){"lol.patch", "asfklhasflhk"}, &(file){"oof.patch", "you just got rekt by some young guy"}, @@ -174,10 +180,17 @@ int main_loop(config *cfg, int *listen_sockets, git_repo **repos) { } for (; !done;) { - if (create_pull_request_dir(pr, -1, cfg->pr_root) < 0) { + pull_request *new_pr; + if (create_pull_request_dir(pr, idx, cfg->pr_root) < 0) { log(LOG_ERR, "Failed to create Pull Request directory."); return -1; } + new_pr = get_pull_request(idx, cfg->pr_root); + if (new_pr == NULL) { + char *idx_str = index_to_str(idx); + log(LOG_ERR, "Failed to get Pull Request #%s.", idx_str); + free(idx_str); + } break; } |