exit 0: no git repo-local var is set and CBM_GITENV_KEEP=kept; exit 3: a git * var leaked; exit 4: the unrelated variable was lost. */
| 1692 | /* exit 0: no git repo-local var is set and CBM_GITENV_KEEP=kept; exit 3: a git |
| 1693 | * var leaked; exit 4: the unrelated variable was lost. */ |
| 1694 | static void gitenv_probe_script(char *buf, size_t cap) { |
| 1695 | size_t n = (size_t)snprintf(buf, cap, "[ \"$CBM_GITENV_KEEP\" = kept ] || exit 4;"); |
| 1696 | for (int i = 0; i < CBM_GIT_REPO_ENV_VAR_COUNT && n < cap; i++) { |
| 1697 | n += (size_t)snprintf(buf + n, cap - n, " [ -z \"${%s+x}\" ] || exit 3;", |
| 1698 | cbm_git_repo_env_vars[i]); |
| 1699 | } |
| 1700 | if (n < cap) { |
| 1701 | (void)snprintf(buf + n, cap - n, " exit 0"); |
| 1702 | } |
| 1703 | } |
| 1704 | |
| 1705 | static int gitenv_spawn_probe(bool strip) { |
| 1706 | char script[2048]; |
no outgoing calls
no test coverage detected