Commit c6d75bc
alias: add support for aliases of an alias
Aliases can only contain non-alias git commands and their arguments,
not other user-defined aliases. Resolving further (nested) aliases
is prevented by breaking the loop after the first alias was
processed. Git then fails with a command-not-found error.
Allow resolving nested aliases by not breaking the loop in
run_argv() after the first alias was processed. Instead, continue
the loop until `handle_alias()` fails, which means that there are no
further aliases that can be processed. Prevent looping aliases by
storing substituted commands in `cmd_list` and checking if a command
has been substituted previously.
While we're at it, fix a styling issue just below the added code.
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 1d4361b commit c6d75bc
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
677 | 678 | | |
678 | 679 | | |
679 | 680 | | |
| |||
691 | 692 | | |
692 | 693 | | |
693 | 694 | | |
694 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
695 | 704 | | |
696 | 705 | | |
697 | 706 | | |
698 | | - | |
699 | | - | |
700 | 707 | | |
701 | 708 | | |
702 | 709 | | |
703 | 710 | | |
704 | 711 | | |
| 712 | + | |
| 713 | + | |
705 | 714 | | |
706 | 715 | | |
707 | 716 | | |
| |||
0 commit comments