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:
Greg Brockman
2010-08-07 01:13:39 -04:00
committed by Junio C Hamano
parent 64fdc08dac
commit ad9ac6db5d
4 changed files with 18 additions and 4 deletions

View File

@ -1096,6 +1096,8 @@ void overlay_tree_on_cache(const char *tree_name, const char *prefix);
char *alias_lookup(const char *alias);
int split_cmdline(char *cmdline, const char ***argv);
/* Takes a negative value returned by split_cmdline */
const char *split_cmdline_strerror(int cmdline_errno);
/* builtin/merge.c */
int checkout_fast_forward(const unsigned char *from, const unsigned char *to);