fix(doctor): remove blocking git fetch from clone divergence check

The CloneDivergenceCheck was calling git fetch for each clone without
a timeout, causing gt doctor to hang indefinitely when network or
authentication issues occurred. Removed the fetch - divergence detection
now uses existing local refs (may be stale but won't block).

Fixes: gt-aoklf8

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/jack
2026-01-17 00:39:14 -08:00
committed by Steve Yegge
parent 8880c61067
commit 6d29f34cd0

View File

@@ -527,12 +527,7 @@ func (c *CloneDivergenceCheck) getCloneInfo(path string) (cloneInfo, error) {
}
info.headSHA = strings.TrimSpace(string(out))
// Fetch to make sure we have latest refs (silent, ignore errors)
cmd = exec.Command("git", "fetch", "--quiet")
cmd.Dir = path
_ = cmd.Run()
// Count commits behind origin/main
// Count commits behind origin/main (uses existing refs, may be stale)
cmd = exec.Command("git", "rev-list", "--count", "HEAD..origin/main")
cmd.Dir = path
out, err = cmd.Output()