mirror of
https://github.com/git/git.git
synced 2024-11-19 00:34:00 +01:00
Print a sane error message if an alias expands to an invalid git command
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
471efb09aa
commit
f3dd015c91
9
git.c
9
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));
|
||||
|
Loading…
Reference in New Issue
Block a user