Commit 9d16ca6
rev-parse: add helper for parsing "--foo/--foo="
We can't just use a bare skip_prefix() for these cases,
because we need to match both the "--foo" form and the
"--foo=<value>" form (and tell the difference between the
two in the caller).
We can wrap this in a simple helper which has two obvious
callsites, and will gain some more in the next patch.
Note that the error output for abbrev-ref changes slightly,
as we don't keep our original "arg" pointer. However, the
new output should hopefully be more clear:
[before]
fatal: unknown mode for --abbrev-ref=foo
[after]
fatal: unknown mode for --abbrev-ref: foo
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent ef87cc7 commit 9d16ca6
1 file changed
Lines changed: 28 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
538 | 557 | | |
539 | 558 | | |
540 | 559 | | |
| |||
671 | 690 | | |
672 | 691 | | |
673 | 692 | | |
674 | | - | |
675 | | - | |
| 693 | + | |
676 | 694 | | |
677 | 695 | | |
678 | 696 | | |
679 | | - | |
| 697 | + | |
680 | 698 | | |
681 | | - | |
| 699 | + | |
682 | 700 | | |
683 | 701 | | |
684 | 702 | | |
| |||
701 | 719 | | |
702 | 720 | | |
703 | 721 | | |
704 | | - | |
705 | | - | |
| 722 | + | |
706 | 723 | | |
707 | 724 | | |
708 | | - | |
709 | | - | |
| 725 | + | |
| 726 | + | |
710 | 727 | | |
711 | | - | |
| 728 | + | |
712 | 729 | | |
713 | 730 | | |
714 | | - | |
| 731 | + | |
| 732 | + | |
715 | 733 | | |
716 | 734 | | |
717 | 735 | | |
| |||
0 commit comments