From 79d49b7d8c75b80d5aeaf9d84895361b85e9c748 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 14 Feb 2018 10:51:58 -0800 Subject: merge-recursive: check for file level conflicts then get new name Before trying to apply directory renames to paths within the given directories, we want to make sure that there aren't conflicts at the file level either. If there aren't any, then get the new name from any directory renames. Reviewed-by: Stefan Beller Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- strbuf.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'strbuf.h') diff --git a/strbuf.h b/strbuf.h index 14c8c10d66..e2e9e5be22 100644 --- a/strbuf.h +++ b/strbuf.h @@ -1,6 +1,8 @@ #ifndef STRBUF_H #define STRBUF_H +struct string_list; + /** * strbuf's are meant to be used with all the usual C string and memory * APIs. Given that the length of the buffer is known, it's often better to @@ -528,6 +530,20 @@ static inline struct strbuf **strbuf_split(const struct strbuf *sb, return strbuf_split_max(sb, terminator, 0); } +/* + * Adds all strings of a string list to the strbuf, separated by the given + * separator. For example, if sep is + * ', ' + * and slist contains + * ['element1', 'element2', ..., 'elementN'], + * then write: + * 'element1, element2, ..., elementN' + * to str. If only one element, just write "element1" to str. + */ +extern void strbuf_add_separated_string_list(struct strbuf *str, + const char *sep, + struct string_list *slist); + /** * Free a NULL-terminated list of strbufs (for example, the return * values of the strbuf_split*() functions). -- cgit v1.2.3