summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-08-05 22:42:12 +0200
committerJunio C Hamano <gitster@pobox.com>2016-08-05 15:10:35 -0700
commitaf4941d444f8bbbc02f68472f4cd6d5846ee043c (patch)
tree3079f5d707915054516d0d60b4592a9576e8fe43 /merge-recursive.c
parent08df31eeccfe1576971ea4ba42570a424c3cfc41 (diff)
downloadgit-af4941d444f8bbbc02f68472f4cd6d5846ee043c.tar.gz
merge-recursive: use STRING_LIST_INIT_NODUPrs/merge-recursive-string-list-init
Initialize a string_list right when it's defined. That's shorter, saves a function call and makes it more obvious that we're using the NODUP variant here. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 65cb5d6c1f..3bba90850f 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -400,7 +400,7 @@ static void record_df_conflict_files(struct merge_options *o,
* and the file need to be present, then the D/F file will be
* reinstated with a new unique name at the time it is processed.
*/
- struct string_list df_sorted_entries;
+ struct string_list df_sorted_entries = STRING_LIST_INIT_NODUP;
const char *last_file = NULL;
int last_len = 0;
int i;
@@ -413,7 +413,6 @@ static void record_df_conflict_files(struct merge_options *o,
return;
/* Ensure D/F conflicts are adjacent in the entries list. */
- memset(&df_sorted_entries, 0, sizeof(struct string_list));
for (i = 0; i < entries->nr; i++) {
struct string_list_item *next = &entries->items[i];
string_list_append(&df_sorted_entries, next->string)->util =