Portable git: `git -C " " ` with identity + non-interactive * config injected via -c, so it needs no global config and no POSIX shell * (runs under cmd.exe on Windows). Returns the git exit status. */
| 35 | * config injected via -c, so it needs no global config and no POSIX shell |
| 36 | * (runs under cmd.exe on Windows). Returns the git exit status. */ |
| 37 | static int wt_git(const char *dir, const char *args) { |
| 38 | char cmd[1024]; |
| 39 | snprintf(cmd, sizeof(cmd), |
| 40 | "git -C \"%s\" -c user.name=t -c user.email=t@t.io " |
| 41 | "-c init.defaultBranch=master -c commit.gpgsign=false %s", |
| 42 | dir, args); |
| 43 | return system(cmd); |
| 44 | } |
| 45 | /* Build "<dir>/<rel>" into buf (forward slashes work on Windows + git). */ |
| 46 | static const char *wt_path(char *buf, size_t n, const char *dir, const char *rel) { |
| 47 | snprintf(buf, n, "%s/%s", dir, rel); |