Skip to content

fix: distinguish missing vs corrupt git config errors - #1610

Merged
max-sixty merged 2 commits into
mainfrom
fix/config-exit-code-handling
Mar 19, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/config-exit-code-handling

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Summary

  • config_value() now checks git config exit codes instead of mapping all errors to Ok(None). Exit 1 (key not found) returns Ok(None); other exit codes (corrupt config, permission denied) are propagated as errors.
  • Same fix applied to clear_hint() and clear_default_branch_cache() which use --unset (exit 5 = key not found).

Closes #1580

Test plan

  • All existing unit and integration tests pass (config, hints, default branch)
  • Verified exit codes empirically: git config --get returns 1 for missing keys, git config --unset returns 5
  • CI passes on all platforms

🤖 Generated with Claude Code

`config_value()` was mapping all git config errors to `Ok(None)`,
silently swallowing real problems like corrupt configs or permission
denied. Now checks exit codes: exit 1 = key not found (Ok(None)),
other codes = propagated error.

Also fixes `clear_hint()` and `clear_default_branch_cache()` which
had the same pattern with `--unset` (exit 5 = key not found).

Closes #1580

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verify that config_value() and clear_hint() propagate errors from
corrupt git configs instead of silently returning Ok(None)/Ok(false).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@max-sixty
max-sixty merged commit ed2224f into main Mar 19, 2026
21 of 22 checks passed
@max-sixty
max-sixty deleted the fix/config-exit-code-handling branch March 19, 2026 01:51
worktrunk-bot added a commit that referenced this pull request Mar 19, 2026
The review bot consistently performs full code analysis (10-18 minutes
of CI compute) on self-authored PRs, only to stay silent because it
cannot approve its own work. Observed 6 times across PRs #1610, #1613,
#1614, #1619, #1622, #1623.

Add early-exit guidance in step 1 to skip steps 2-4 for self-authored
PRs. The bot still monitors CI and resolves threads, but skips the
redundant code review that always produces zero visible output.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_config() swallows all git errors instead of distinguishing missing vs corrupt

2 participants