summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/git.c b/git.c
index 61c2408..495b08f 100644
--- a/git.c
+++ b/git.c
@@ -304,18 +304,18 @@ int create_pull_request_dir(pull_request *pr, int id, const char *root) {
/* 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;
- }
-
/* Is there no existing directory? */
if (stat(pr_dir, &st) < 0) {
/* Create a directory with a name of the stringified ID. */
mkdir(pr_dir, 0755);
}
+ /* 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 patch files. */
commits = (pr->pr_type) ? get_branch_commits(pr->branch) : pr->patches;