worktrunk
worktrunk copied to clipboard
get_config() swallows all git errors instead of distinguishing missing vs corrupt
Summary
In src/git/repository/config.rs, get_config() treats ALL git config errors as "key doesn't exist" by mapping Err(_) => Ok(None).
git config --get uses distinct exit codes:
- Exit 1: key not found
- Exit 128+: actual error (corrupt config, permission denied, etc.)
Currently, a corrupt git config or permission error silently returns None, which could mask real problems.
Location
src/git/repository/config.rs:15- Also
clear_hintat line 91 swallows errors similarly (though that's more defensible as best-effort).
Suggested fix
Check the exit code: return Ok(None) for exit code 1, propagate the error for other exit codes.
ok, make this change
Done — #1610.
config_value() now checks exit codes: 1 = key not found (Ok(None)), anything else propagated. Same fix for clear_hint() and clear_default_branch_cache() which use --unset (exit 5 = not found).