split_cmdline: Allow caller to access error string
This allows the caller to add its own error message to that returned by split_cmdline. Thus error output following a failed split_cmdline can be of the form fatal: Bad alias.test string: cmdline ends with \ rather than error: cmdline ends with \ fatal: Bad alias.test string Signed-off-by: Greg Brockman <gdb@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
64fdc08dac
commit
ad9ac6db5d
3
git.c
3
git.c
@ -188,7 +188,8 @@ static int handle_alias(int *argcp, const char ***argv)
|
||||
}
|
||||
count = split_cmdline(alias_string, &new_argv);
|
||||
if (count < 0)
|
||||
die("Bad alias.%s string", alias_command);
|
||||
die("Bad alias.%s string: %s", alias_command,
|
||||
split_cmdline_strerror(count));
|
||||
option_count = handle_options(&new_argv, &count, &envchanged);
|
||||
if (envchanged)
|
||||
die("alias '%s' changes environment variables\n"
|
||||
|
Reference in New Issue
Block a user