| 30 | } |
| 31 | |
| 32 | static void trim_newlines(char *s) { |
| 33 | if (!s) { |
| 34 | return; |
| 35 | } |
| 36 | size_t n = strlen(s); |
| 37 | while (n > 0 && (s[n - 1] == '\n' || s[n - 1] == '\r')) { |
| 38 | s[--n] = '\0'; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | static bool git_validate_repo_path(const char *repo_path) { |
| 43 | if (!cbm_validate_shell_arg(repo_path)) { |