summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-07-30 11:29:50 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-08-10 14:13:44 -0300
commitc62604d54a765273f34396e81ef3130dd21562a9 (patch)
tree4f469e37090d3bb096cf64849ad4cf10c2e117ca
parent522ee790ae8a37064bbf830e25bfea8628cae1df (diff)
dev: Add some more test code
-rw-r--r--pullreqd.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/pullreqd.c b/pullreqd.c
index 33da015..53973cd 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -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;
}