From 84262d9f69aa6730c69f464b5b4fb7f6030bf329 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 Jun 2026 19:51:00 +0200 Subject: switch from tabs to spaces It was fun while it lasted, but I do believe that spaces are strictly superior, and clang-format struggles with tabs while using advanced configuration options. --- src/ci.c | 78 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'src/ci.c') diff --git a/src/ci.c b/src/ci.c index a2bd2f0..4692b19 100644 --- a/src/ci.c +++ b/src/ci.c @@ -34,70 +34,70 @@ 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}; - return process_execute_and_capture(args, ci_env, 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) { - if (!file_exists(*script)) - continue; - log("Going to run: %s\n", *script); - return ci_run_script(*script, result); - } - - log("Couldn't find any CI scripts to run\n"); - return -1; + for (const char** script = ci_scripts; *script; ++script) { + if (!file_exists(*script)) + continue; + log("Going to run: %s\n", *script); + return ci_run_script(*script, result); + } + + log("Couldn't find any CI scripts to run\n"); + return -1; } static void ci_cleanup_git_repo(git_repository* repo) { - rm_rf(git_repository_workdir(repo)); - libgit_repository_free(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) { - int ret = 0; + int ret = 0; - ret = libgit_clone_to_tmp(repo, url); - if (ret < 0) - return ret; + ret = libgit_clone_to_tmp(repo, url); + if (ret < 0) + return ret; - ret = libgit_checkout(*repo, rev); - if (ret < 0) - goto cleanup_repo; + ret = libgit_checkout(*repo, rev); + if (ret < 0) + goto cleanup_repo; - return ret; + return ret; cleanup_repo: - ci_cleanup_git_repo(*repo); + ci_cleanup_git_repo(*repo); - return ret; + 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 ret = 0; + char* oldpwd = NULL; + git_repository* repo = NULL; + int ret = 0; - ret = ci_prepare_git_repo(&repo, url, rev); - if (ret < 0) - goto exit; + ret = ci_prepare_git_repo(&repo, url, rev); + if (ret < 0) + goto exit; - ret = chdir_wrapper(git_repository_workdir(repo), &oldpwd); - if (ret < 0) - goto free_repo; + ret = chdir_wrapper(git_repository_workdir(repo), &oldpwd); + if (ret < 0) + goto free_repo; - ret = ci_run(output); - if (ret < 0) - goto oldpwd; + ret = ci_run(output); + if (ret < 0) + goto oldpwd; oldpwd: - chdir_wrapper(oldpwd, NULL); - free(oldpwd); + chdir_wrapper(oldpwd, NULL); + free(oldpwd); free_repo: - ci_cleanup_git_repo(repo); + ci_cleanup_git_repo(repo); exit: - return ret; + return ret; } -- cgit v1.3