Repository navigation
Commit f41f090
lpb-docs
fix(lpb-config): status reported ahead as behind (swapped is-ancestor check)
cmd_status used 'merge-base --is-ancestor HEAD origin/<ref>': exit 0 means
local is BEHIND (or equal) but was reported 'up to date (or ahead)', while
local AHEAD fell into the 'behind remote' branch. Replace with
'rev-list --left-right --count' so status distinguishes up-to-date /
ahead / behind / diverged with exact counts.
Also use 'rev-parse --verify' for origin/<ref> in status/update/reset/merge:
plain rev-parse echoes the ref name to stdout on failure, producing a
fake remote head ('origin/main' string) that bypassed the empty guards.
Tests: status ahead/behind/up-to-date/diverged + missing-ref regression.1 parent 638294e commit f41f090
2 files changed
Lines changed: 98 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
317 | 318 | | |
318 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
319 | 336 | | |
320 | 337 | | |
321 | 338 | | |
| |||
334 | 351 | | |
335 | 352 | | |
336 | 353 | | |
337 | | - | |
| 354 | + | |
338 | 355 | | |
339 | 356 | | |
340 | 357 | | |
| |||
387 | 404 | | |
388 | 405 | | |
389 | 406 | | |
390 | | - | |
| 407 | + | |
391 | 408 | | |
392 | 409 | | |
393 | 410 | | |
| |||
422 | 439 | | |
423 | 440 | | |
424 | 441 | | |
425 | | - | |
| 442 | + | |
426 | 443 | | |
427 | 444 | | |
428 | 445 | | |
| |||
| 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 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
144 | 217 | | |
145 | 218 | | |
146 | 219 | | |
| |||
0 commit comments