Repository navigation
Commit c760f9c
fix: [#830] address coderabbit heavy-lift — distinguish degraded-git from clean non-repo
Reviewer correctly flagged that non-zero rev-parse exit was being
bucketed as a clean "not a repo" signal, potentially masking corrupted-
.git or permission-denied failures. The previous implementation had
three states (git missing / valid git / not a repo) collapsing into two
display branches.
Added a `gitError?: { exitCode, stderr }` field on GitInfo so callers
can distinguish:
isRepo=false, gitAvailable=true, gitError=undefined → clean non-repo
isRepo=false, gitAvailable=true, gitError=<exit> → degraded git
isRepo=false, gitAvailable=false → git missing
Exit 128 (git's standard "fatal" for not-in-a-repo) remains the clean
non-repo signal. Any other non-zero exit now surfaces via gitError, gets
recorded in degraded.add("git"), and renders as
"✗ git error (exit N): <stderr-snippet>" instead of silently bucketing
as "Not a git repository".
Test added to pin: clean non-repo dir has gitError undefined. The
degraded-git path is hard to force in a unit test (would require
seeding a malformed .git), but the contract is small enough that the
type and the comment carry the burden.
84/84 tests pass; no upstream-shared file changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 03cdb68 commit c760f9c
2 files changed
Lines changed: 65 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
84 | | - | |
| 94 | + | |
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
| |||
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| 104 | + | |
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
| |||
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
110 | 124 | | |
111 | 125 | | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
116 | 140 | | |
117 | 141 | | |
118 | 142 | | |
| |||
620 | 644 | | |
621 | 645 | | |
622 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
623 | 655 | | |
624 | 656 | | |
625 | 657 | | |
| |||
847 | 879 | | |
848 | 880 | | |
849 | 881 | | |
850 | | - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
851 | 888 | | |
852 | 889 | | |
853 | 890 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
144 | 164 | | |
145 | 165 | | |
146 | 166 | | |
| |||
0 commit comments