fix(shell): check git repo before running git commands to prevent TCC prompts (#1677)

Co-authored-by: BillionClaw <billionclaw@users.noreply.github.com>
This commit is contained in:
BillionToken 2026-03-20 15:13:58 +08:00 committed by GitHub
parent e0c301b277
commit af45c421e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -451,6 +451,8 @@ _cmux_prompt_command() {
_CMUX_GIT_LAST_PWD="$pwd"
_CMUX_GIT_LAST_RUN=$now
{
# Skip git operations if not in a git repository to avoid TCC prompts
git rev-parse --git-dir >/dev/null 2>&1 || return 0
local branch dirty_opt=""
branch=$(git branch --show-current 2>/dev/null)
if [[ -n "$branch" ]]; then