summaryrefslogtreecommitdiff
path: root/strbuf.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-04-19 17:58:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-08 07:11:00 (GMT)
commitf6f775591881036a3c4bfcf6737c9119c251537d (patch)
tree769a7e72d7ccd4107fe64e512a3448393cd7e9de /strbuf.h
parente95ab70aac4f38f1d365cdc03a7a041920c9c27b (diff)
downloadgit-f6f775591881036a3c4bfcf6737c9119c251537d.zip
git-f6f775591881036a3c4bfcf6737c9119c251537d.tar.gz
git-f6f775591881036a3c4bfcf6737c9119c251537d.tar.bz2
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 <sbeller@google.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.h')
-rw-r--r--strbuf.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/strbuf.h b/strbuf.h
index 4efa80c..c4de5e4 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
@@ -537,6 +539,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).