Commit 1d1cd6a
committed
fix(git): flip
The `first` flag (used to skip the main worktree entry) was not set
to `false` until the blank-line separator was encountered. This meant
that if the separator were ever missing, every linked worktree would
be silently skipped.
Move `first = false` into the `worktree` line handler where it
logically belongs, and simplify the empty-line handler accordingly.
Also replace a hand-rolled `contains` helper in tests with
`strings.Contains`.first flag immediately in ListWorktrees
1 parent 26f48d3 commit 1d1cd6a
2 files changed
+4
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
| 319 | + | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | 339 | | |
343 | 340 | | |
344 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
686 | | - | |
| 687 | + | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
| |||
708 | 709 | | |
709 | 710 | | |
710 | 711 | | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | 712 | | |
726 | 713 | | |
727 | 714 | | |
| |||
0 commit comments