| 37 | } tie_fixture_t; |
| 38 | |
| 39 | static bool tie_git(tie_fixture_t *fx, const char *const *tail) { |
| 40 | const char *argv[32] = {fx->git, |
| 41 | "-C", |
| 42 | fx->repo, |
| 43 | "-c", |
| 44 | "commit.gpgSign=false", |
| 45 | "-c", |
| 46 | "core.autocrlf=false", |
| 47 | "-c", |
| 48 | "user.name=t", |
| 49 | "-c", |
| 50 | "user.email=t@example.invalid"}; |
| 51 | size_t n = 11; |
| 52 | for (size_t i = 0; tail[i] && n + 1 < sizeof(argv) / sizeof(argv[0]); i++) { |
| 53 | argv[n++] = tail[i]; |
| 54 | } |
| 55 | argv[n] = NULL; |
| 56 | cbm_proc_opts_t opts = {.bin = fx->git, |
| 57 | .argv = argv, |
| 58 | .log_file = fx->log, |
| 59 | .strip_git_repo_env = true, |
| 60 | .quiet_timeout_ms = 20000}; |
| 61 | cbm_proc_result_t result = {0}; |
| 62 | return cbm_subprocess_run(&opts, &result) == 0 && result.outcome == CBM_PROC_CLEAN && |
| 63 | result.exit_code == 0; |
| 64 | } |
| 65 | |
| 66 | static bool tie_write(tie_fixture_t *fx, const char *rel, const char *content) { |
| 67 | return th_write_file(TH_PATH(fx->repo, rel), content) == 0; |
no test coverage detected