Commit 93e5ec5
Fix hook v1→v2 upgrade: strip & and document install-hook --force (#207)
## Summary
- Fix the v1→v2 hook upgrade path to patch in place: strips trailing `&`
from the enqueue line and adds the v2 version marker
- For hooks already corrupted by a previous buggy upgrade (e.g. stray
`fi`), the recommended fix is `roborev install-hook --force`
- Remove the `removeStrayFi()` auto-repair logic in favor of the simpler
`--force` approach
## Test plan
- [x] `TestInitCmdUpgradesOutdatedHook` — v1 hook gets `&` stripped and
marker added
- [x] `TestInitCmdPreservesOtherHooksOnUpgrade` — non-roborev hook
content preserved during upgrade
- [x] Full test suite passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 2020137 commit 93e5ec5
2 files changed
+24
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
313 | | - | |
| 312 | + | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
338 | 345 | | |
339 | 346 | | |
340 | 347 | | |
| |||
349 | 356 | | |
350 | 357 | | |
351 | 358 | | |
352 | | - | |
| 359 | + | |
353 | 360 | | |
354 | 361 | | |
355 | 362 | | |
| |||
374 | 381 | | |
375 | 382 | | |
376 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
377 | 387 | | |
378 | 388 | | |
379 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
355 | 358 | | |
| 359 | + | |
356 | 360 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
| 361 | + | |
372 | 362 | | |
373 | 363 | | |
374 | 364 | | |
| |||
2839 | 2829 | | |
2840 | 2830 | | |
2841 | 2831 | | |
2842 | | - | |
2843 | | - | |
2844 | | - | |
2845 | 2832 | | |
2846 | 2833 | | |
2847 | 2834 | | |
| |||
0 commit comments