summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-30 09:31:10 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-30 09:31:10 -0400
commit696bc8db36957e43756d88a093969ef16e8a4a47 (patch)
tree0fe41f25de473ee9985a1bed44ae6815458865a6 /git.c
parent553629ca70032aea2397f1588b060dc96df7d2fc (diff)
Moved assignment of `pr_dir` to before the creation of
the info file.
Diffstat (limited to 'git.c')
-rw-r--r--git.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/git.c b/git.c
index a767624..191b800 100644
--- a/git.c
+++ b/git.c
@@ -256,15 +256,16 @@ int create_pull_request_dir(pull_request *pr, int id, const char *root) {
log(LOG_ERR, "Negative ID, and either blank, or NULL Pull Request title.");
return -1;
}
+
+ /* Get the path of the PR's directory. */
+ pr_dir = (pr->title != NULL && pr->title[0] != '\0') ? dir_path_name(root, sanitize_str(pr->title)) : dir_path_num(root, id);
+
/* Did we fail to create the info file? */
if (!create_info_file(pr, pr_dir)) {
log(LOG_ERR, "Failed to create info file.");
return -1;
}
- /* Get the path of the PR's directory. */
- pr_dir = (pr->title != NULL && pr->title[0] != '\0') ? dir_path_name(root, sanitize_str(pr->title)) : dir_path_num(root, id);
-
/* Is there no existing directory? */
if (stat(pr_dir, &st) < -1) {
/* Create a directory with a name of the stringified ID. */