author | Adeodato Simó <dato@net.com.org.es> | |
Sun, 4 Jan 2009 17:16:01 +0000 (18:16 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Jan 2009 20:54:07 +0000 (12:54 -0800) | ||
commit | a907e1b6ec3038306df68dc1275edad7457bba4b | |
tree | cab1613ca81299ac843b5f8c4fd9cf3de175183f | tree | snapshot |
parent | e89e2ed7c225cf16cffbd9648895528e471e2fb8 | commit | diff |
git.c: make autocorrected aliases work
help_unknown_cmd() is able to autocorrect a command to an alias, and not
only to internal or external commands. However, main() was not passing the
autocorrected command through handle_alias(), hence it failed if it was an
alias.
This commit makes the autocorrected command go through handle_alias(), once
handle_internal_command() and execv_dashed_external() have been tried. Since
this is done twice in main() now, moved that logic to a new run_argv()
function.
Also, print the same "Expansion of alias 'x' failed" message when the alias
was autocorrected, rather than a generic "Failed to run command 'x'".
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
help_unknown_cmd() is able to autocorrect a command to an alias, and not
only to internal or external commands. However, main() was not passing the
autocorrected command through handle_alias(), hence it failed if it was an
alias.
This commit makes the autocorrected command go through handle_alias(), once
handle_internal_command() and execv_dashed_external() have been tried. Since
this is done twice in main() now, moved that logic to a new run_argv()
function.
Also, print the same "Expansion of alias 'x' failed" message when the alias
was autocorrected, rather than a generic "Failed to run command 'x'".
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git.c | diff | blob | history |