summaryrefslogtreecommitdiff
path: root/pullreqd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pullreqd.c')
-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;
}