summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-02-14 18:51:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-14 21:02:53 (GMT)
commit79d49b7d8c75b80d5aeaf9d84895361b85e9c748 (patch)
tree7a79a6c42f0bc7d2662246e53c04d0b60fbb4861 /strbuf.c
parentea625cb0274c6907fba02f7af3ab83458b331a1e (diff)
downloadgit-79d49b7d8c75b80d5aeaf9d84895361b85e9c748.zip
git-79d49b7d8c75b80d5aeaf9d84895361b85e9c748.tar.gz
git-79d49b7d8c75b80d5aeaf9d84895361b85e9c748.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.c')
-rw-r--r--strbuf.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/strbuf.c b/strbuf.c
index 1df674e..113e751 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "refs.h"
+#include "string-list.h"
#include "utf8.h"
int starts_with(const char *str, const char *prefix)
@@ -163,6 +164,21 @@ struct strbuf **strbuf_split_buf(const char *str, size_t slen,
return ret;
}
+void strbuf_add_separated_string_list(struct strbuf *str,
+ const char *sep,
+ struct string_list *slist)
+{
+ struct string_list_item *item;
+ int sep_needed = 0;
+
+ for_each_string_list_item(item, slist) {
+ if (sep_needed)
+ strbuf_addstr(str, sep);
+ strbuf_addstr(str, item->string);
+ sep_needed = 1;
+ }
+}
+
void strbuf_list_free(struct strbuf **sbs)
{
struct strbuf **s = sbs;