diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2020-12-16 15:50:30 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-18 21:56:40 +0100 |
commit | 38e95844e8f9bfefb34443650e99f740581a394b (patch) | |
tree | 84dbef256620114336c98e7b99951f8b25a4a5e9 /convert.h | |
parent | Git 2.31 (diff) | |
download | git-38e95844e8f9bfefb34443650e99f740581a394b.tar.xz git-38e95844e8f9bfefb34443650e99f740581a394b.zip |
convert: make convert_attrs() and convert structs public
Move convert_attrs() declaration from convert.c to convert.h, together
with the conv_attrs struct and the crlf_action enum. This function and
the data structures will be used outside convert.c in the upcoming
parallel checkout implementation. Note that crlf_action is renamed to
convert_crlf_action, which is more appropriate for the global namespace.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'convert.h')
-rw-r--r-- | convert.h | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -63,6 +63,30 @@ struct checkout_metadata { struct object_id blob; }; +enum convert_crlf_action { + CRLF_UNDEFINED, + CRLF_BINARY, + CRLF_TEXT, + CRLF_TEXT_INPUT, + CRLF_TEXT_CRLF, + CRLF_AUTO, + CRLF_AUTO_INPUT, + CRLF_AUTO_CRLF +}; + +struct convert_driver; + +struct conv_attrs { + struct convert_driver *drv; + enum convert_crlf_action attr_action; /* What attr says */ + enum convert_crlf_action crlf_action; /* When no attr is set, use core.autocrlf */ + int ident; + const char *working_tree_encoding; /* Supported encoding or default encoding if NULL */ +}; + +void convert_attrs(const struct index_state *istate, + struct conv_attrs *ca, const char *path); + extern enum eol core_eol; extern char *check_roundtrip_encoding; const char *get_cached_convert_stats_ascii(const struct index_state *istate, |