Skip to content

doctor: exit with 'not a git repository' when run outside a repository - #3247

Open
sreeram-venkitesh wants to merge 1 commit into
entireio:mainfrom
sreeram-venkitesh:svenkitesh/fix-entire-doctor-error-outside-repo
Open

sreeram-venkitesh wants to merge 1 commit into
entireio:mainfrom
sreeram-venkitesh:svenkitesh/fix-entire-doctor-error-outside-repo

Conversation

@sreeram-venkitesh

Copy link
Copy Markdown

Fixes #3246

Running entire doctor outside a git repository ran every repository check anyway. Each check failed on its own, so the output was three wrapped git errors ending in a bare exit status 128.

Doctor now still runs the per-user config check, since that check doesn't need a repository and doctor is where a bad config.json gets reported. It then stops with a single not a git repository and exits 1, the same way doctor bundle, doctor logs, checkpoint and clean do. Other ways of failing to resolve the repository (git missing, dubious ownership) are still caught earlier by reportBrokenEntireDir, so they keep their own diagnosis.

checkUserConfig now returns its error already wrapped in NewSilentError, since the lines it prints are the user-facing message.

The new behaviour looks like the following:
image

@sreeram-venkitesh
sreeram-venkitesh requested a review from a team as a code owner November 29, 2026 08:59
Copilot AI balanced review requested due to automatic review settings November 29, 2026 08:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

entire doctor outside a git repository prints three wrapped git errors

2 participants