Skip to main content

GIT_FUNCTION_BODY

Constant GIT_FUNCTION_BODY 

Source
pub const GIT_FUNCTION_BODY: &str = r#"() {  if [ -n "${AGENTMUX_GITHUB_BROKER:-}" ]; then
    case " $* " in
      *" push "*|*" commit "*|*" merge "*|*" rebase "*|*" cherry-pick "*|*" am "*|*" revert "*|*" pull "*|*" stash "*)
        local _amx_e _amx_v=();
        _amx_e="$(agentmux-bashwrap git-env -- "$@")" || return $?;
        if [ -n "$_amx_e" ]; then
          IFS=$'\n' read -r -d '' -a _amx_v <<< "$_amx_e" || true;
          ( export "${_amx_v[@]}"; command git "$@" );
          return $?;
        fi;;
    esac;
  fi;
  command git "$@"
}"#;
Expand description

git, for the same agents: a push or a command that makes commits first asks agentmux-bashwrap git-env, which refuses what would skip the hooks (git push --no-verify) and names the App’s bot as the commit’s author. Any other git command is plain git.