Repository navigation
Commit d536891
fix(git): keep the trailing newline on filtered 'git status' output
`filter_status_with_args` joins kept lines with \n and has no terminal
newline; `never_worse` may instead return git's raw stdout, which does.
`print!` on either is wrong in one of the two cases, so the arg-carrying
status path (--short / -s / --porcelain) dropped the final newline.
The last entry then glues to whatever prints next, and — worse than
cosmetic — any pipeline that counts lines undercounts by one:
git status --porcelain | cat -A -> ?? handoff/$ (1 line)
rtk git status --porcelain | cat -A -> ?? handoff/ (0 lines)
On a tree with a single change, `rtk git status --porcelain | wc -l`
therefore reports 0 — a false 'clean' on the exact question the command
is usually asked. Anything gating a commit/no-commit decision on piped
porcelain output takes the wrong branch.
Normalize to exactly one trailing newline via a pure, unit-tested
`with_trailing_newline`. Empty output stays empty: --porcelain on a
clean tree correctly prints nothing.1 parent 01e7ac1 commit d536891
1 file changed
Lines changed: 50 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1469 | 1469 | | |
1470 | 1470 | | |
1471 | 1471 | | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1472 | 1491 | | |
1473 | 1492 | | |
1474 | 1493 | | |
| |||
1527 | 1546 | | |
1528 | 1547 | | |
1529 | 1548 | | |
1530 | | - | |
| 1549 | + | |
1531 | 1550 | | |
1532 | 1551 | | |
1533 | 1552 | | |
| |||
2951 | 2970 | | |
2952 | 2971 | | |
2953 | 2972 | | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
2954 | 3003 | | |
2955 | 3004 | | |
2956 | 3005 | | |
| |||
0 commit comments