| 99 | } |
| 100 | |
| 101 | static int git_capture(const char *repo_path, const char *git_args, char **out) { |
| 102 | if (!out) { |
| 103 | return CBM_NOT_FOUND; |
| 104 | } |
| 105 | *out = NULL; |
| 106 | char buf[GIT_OUTPUT_MAX]; |
| 107 | if (git_capture_into(repo_path, git_args, buf, sizeof(buf)) != 0) { |
| 108 | return CBM_NOT_FOUND; |
| 109 | } |
| 110 | *out = git_strdup(buf); |
| 111 | return *out ? 0 : CBM_NOT_FOUND; |
| 112 | } |
| 113 | |
| 114 | static bool path_is_absolute(const char *path) { |
| 115 | if (!path || !path[0]) { |
no test coverage detected