diff options
Diffstat (limited to 'src/ci.c')
| -rw-r--r-- | src/ci.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -6,12 +6,14 @@ */ #include "ci.h" + #include "file.h" #include "git.h" #include "log.h" #include "process.h" #include <git2.h> + #include <stddef.h> #include <stdlib.h> @@ -31,15 +33,13 @@ static const char *ci_env[] = { }; /* clang-format on */ -static int ci_run_script(const char *script, struct process_output *result) -{ - const char *args[] = {script, NULL}; +static int ci_run_script(const char* script, struct process_output* result) { + const char* args[] = {script, NULL}; return process_execute_and_capture(args, ci_env, result); } -int ci_run(struct process_output *result) -{ - for (const char **script = ci_scripts; *script; ++script) { +int ci_run(struct process_output* result) { + for (const char** script = ci_scripts; *script; ++script) { if (!file_exists(*script)) continue; log("Going to run: %s\n", *script); @@ -50,14 +50,12 @@ int ci_run(struct process_output *result) return -1; } -static void ci_cleanup_git_repo(git_repository *repo) -{ +static void ci_cleanup_git_repo(git_repository* repo) { rm_rf(git_repository_workdir(repo)); libgit_repository_free(repo); } -static int ci_prepare_git_repo(git_repository **repo, const char *url, const char *rev) -{ +static int ci_prepare_git_repo(git_repository** repo, const char* url, const char* rev) { int ret = 0; ret = libgit_clone_to_tmp(repo, url); @@ -76,10 +74,9 @@ cleanup_repo: return ret; } -int ci_run_git_repo(const char *url, const char *rev, struct process_output *output) -{ - char *oldpwd = NULL; - git_repository *repo = NULL; +int ci_run_git_repo(const char* url, const char* rev, struct process_output* output) { + char* oldpwd = NULL; + git_repository* repo = NULL; int ret = 0; ret = ci_prepare_git_repo(&repo, url, rev); |
