Git Handler Layer Rewrite (2026-04-09)

Summary

Complete rewrite of the git/glab handler layer for fault tolerance, reliability, and no silent failures. 96 tests passing (was 61).

GitHandler Changes

  • All remote ops (clone/pull/fetch) use shared remote_cmd() + run_with_timeout() — 120s timeout, 10s for probes
  • Every remote command sets GIT_TERMINAL_PROMPT=0, SSH BatchMode=yes, ConnectTimeout=10
  • clone_repo(url, target_dir, branch) — new target_dir param fixes slug mismatch where git default naming didn’t match project slugs
  • New methods: checkout(), remote_add(), ssh_reachable() (static SSH connectivity probe)
  • New error variant: GitError::Timeout

GlabHandler Changes

  • GlabError::NotInstalled / GlabError::NotAuthenticated — explicit error variants, no more silent failures
  • detect_clone_strategy() probes SSH connectivity before recommending SSH protocol, falls back to HTTPS if unreachable
  • parse_auth_output() extracted as testable unit for parsing glab auth status output
  • Single auth_status_output() call shared across methods (DRY)
  • CloneStrategy::fallback() replaces duplicated manual protocol-switching logic

CliBuffer Changes

  • wrap_future now requires Result return type — shows on success, ✘ <error> on failure
  • No more misleading progress bars that show checkmark regardless of outcome

init.rs Fixes

  • Passes project slug as clone target dir (fixes directory naming mismatch)
  • Uses strategy.fallback() instead of manual protocol switching
  • Proper error handling for glab not-installed / not-authenticated

Test Coverage

96 tests total (was 61). New integration tests cover:

  • Clone with explicit target directory
  • Clone-then-pull roundtrip
  • Checkout and branch switching
  • Worktree full lifecycle (add, list, remove)
  • Remote add and fetch
  • SSH probe for invalid hosts