summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-08-05 14:01:57 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-08-10 14:13:44 -0300
commite6c47d770e699383096b076d856a59d172b112ba (patch)
tree997610486370b061dd30456723ab3fd7644b8197
parent1557593ad4f6040014c826be74730d26bdca7aef (diff)
dev: Add some more test code for testing `create_pull_request_branch()`dev
-rw-r--r--pullreqd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/pullreqd.c b/pullreqd.c
index 30be263..d4e67ea 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -166,12 +166,18 @@ int main_loop(config *cfg, int *listen_sockets, git_repo **repos) {
.num = 0,
.next = NULL,
};
+ index_t *idx2 = &(index_t) {
+ .type = 1,
+ .num = 10,
+ .next = NULL,
+ };
file **patches = (file *[]) {
&(file){"lol.patch", "asfklhasflhk"},
&(file){"oof.patch", "you just got rekt by some young guy"},
NULL
};
pull_request *pr = &(pull_request){"lol", "oof", "some young guy", NULL, time(NULL), 0, {.patches = patches}, NULL};
+ pull_request *pr2 = &(pull_request){"Give actkbd, the ability to turn into an epic Unix utility", "actkbd seems like a cool concept for a keyboard shortcut daemon, but I realised that it was very easy to print keypresses to stdout.\nSo that was what I did, but that was not enough, I really wanted the ability to get the keystate, every tick, which I did.\nOh yeah, I also fixed the regex used for autodetecting a keyboard, so that it actually works.\nHope you guys enjoy it!", "mrb0nk500", NULL, 1568423431, 1, {.branch = &(git_branch){.name = "master", .repo = "https://github.com/mrb0nk500/actkbd.git"}}, "master"};
/* Does the PR root directory exist? */
if (stat(cfg->pr_root, &st) < 0) {
@@ -194,6 +200,16 @@ int main_loop(config *cfg, int *listen_sockets, git_repo **repos) {
cleanup_pull_request(new_pr);
new_pr = NULL;
}
+
+ if (create_pull_request_dir(pr2, idx2, cfg->pr_root, "actkbd") < 0) {
+ log(LOG_ERR, "Failed to create second Pull Request directory.");
+ return -1;
+ }
+
+ if (create_pull_request_branch(pr2, idx2, get_repo(repos, "actkbd")) < 0) {
+ log(LOG_ERR, "Failed to create Pull Request branch.");
+ return -1;
+ }
break;
}