Commit 158d746
committed
worktree_sync(fix[sync_worktree]) Guard against empty plan entries list
why: plan_worktree_sync should always return at least one entry for a single
config input, but an internal bug could cause an empty list. An IndexError
with no context is harder to debug than an explicit ERROR entry.
what:
- Add guard before entries[0] access in sync_worktree
- Return ERROR entry with descriptive message when plan is empty
- Add test mocking empty plan return to verify ERROR instead of crash1 parent 3f45908 commit 158d746
File tree
2 files changed
+37
-0
lines changed- src/vcspull/_internal
- tests
2 files changed
+37
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
658 | 667 | | |
659 | 668 | | |
660 | 669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3389 | 3389 | | |
3390 | 3390 | | |
3391 | 3391 | | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
0 commit comments