summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-08-01 11:30:21 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-08-01 11:30:21 -0400
commit9fb8bf5ca96882cc17f9e4af27ece5268023c1bc (patch)
treebc0f9480f1181754f73a38cc68ac7433248c35e3
parentda12f6a4584c4bdd386a420a81bbb51d0f94c12f (diff)
Set return value to zero, if the PR ID is negative in
`create_pull_request_dir()`.
-rw-r--r--git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/git.c b/git.c
index 495b08f..193c72a 100644
--- a/git.c
+++ b/git.c
@@ -285,7 +285,7 @@ file **get_branch_commits(git_branch *br) {
}
int create_pull_request_dir(pull_request *pr, int id, const char *root) {
- int ret = id;
+ int ret = (id >= 0) ? id : 0;
struct stat st;
file **commits;
char *pr_dir;