From: Theodore Ts'o Date: Sun, 11 Feb 2007 00:33:57 +0000 (-0500) Subject: Print a sane error message if an alias expands to an invalid git command X-Git-Tag: v1.5.0~37 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f3dd015c9147e3116fc1941d96f4dad38386b1db;p=git.git Print a sane error message if an alias expands to an invalid git command Signed-off-by: "Theodore Ts'o" Signed-off-by: Junio C Hamano --- diff --git a/git.c b/git.c index 82a835727..c43d4ff1f 100644 --- a/git.c +++ b/git.c @@ -387,8 +387,15 @@ int main(int argc, const char **argv, char **envp) done_alias = 1; } - if (errno == ENOENT) + if (errno == ENOENT) { + if (done_alias) { + fprintf(stderr, "Expansion of alias '%s' failed; " + "'%s' is not a git-command\n", + cmd, argv[0]); + exit(1); + } help_unknown_cmd(cmd); + } fprintf(stderr, "Failed to run command '%s': %s\n", cmd, strerror(errno));