Commit 7aed2c0
rebase -i: match whole word in is_command()
When matching an unabbreviated command is_command() only does a prefix
match which means it parses "pickled" as TODO_PICK. parse_insn_line()
does error out because is_command() only advances as far as the end of
"pick" so it looks like the command name is not followed by a space but
the error message is "missing arguments for pick" rather than telling
the user that the "pickled" is not a valid command.
Fix this by ensuring the match is follow by whitespace or the end of the
string as we already do for abbreviated commands. The (*bol = p) at the
end of the condition is a bit cute for my taste but I decided to leave
it be for now. Rather than add new tests the existing tests for bad
commands are adapted to use a bad command name that triggers the prefix
matching bug.
Signed-off-by: Phillip Wood <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 768bb23 commit 7aed2c0
3 files changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2469 | 2469 | | |
2470 | 2470 | | |
2471 | 2471 | | |
2472 | | - | |
| 2472 | + | |
2473 | 2473 | | |
2474 | | - | |
2475 | | - | |
2476 | | - | |
2477 | | - | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
2478 | 2477 | | |
2479 | 2478 | | |
2480 | 2479 | | |
| |||
2503 | 2502 | | |
2504 | 2503 | | |
2505 | 2504 | | |
2506 | | - | |
| 2505 | + | |
| 2506 | + | |
2507 | 2507 | | |
2508 | 2508 | | |
2509 | 2509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1449 | 1449 | | |
1450 | 1450 | | |
1451 | 1451 | | |
1452 | | - | |
| 1452 | + | |
| 1453 | + | |
1453 | 1454 | | |
1454 | 1455 | | |
1455 | 1456 | | |
1456 | 1457 | | |
1457 | 1458 | | |
1458 | 1459 | | |
1459 | | - | |
| 1460 | + | |
1460 | 1461 | | |
1461 | 1462 | | |
1462 | 1463 | | |
| |||
1467 | 1468 | | |
1468 | 1469 | | |
1469 | 1470 | | |
1470 | | - | |
| 1471 | + | |
1471 | 1472 | | |
1472 | 1473 | | |
1473 | 1474 | | |
| |||
1483 | 1484 | | |
1484 | 1485 | | |
1485 | 1486 | | |
1486 | | - | |
| 1487 | + | |
| 1488 | + | |
1487 | 1489 | | |
1488 | 1490 | | |
1489 | 1491 | | |
| |||
1583 | 1585 | | |
1584 | 1586 | | |
1585 | 1587 | | |
1586 | | - | |
| 1588 | + | |
1587 | 1589 | | |
1588 | 1590 | | |
1589 | 1591 | | |
| |||
0 commit comments