diff options
Diffstat (limited to 'merge-recursive.c')
-rw-r--r-- | merge-recursive.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index f736a0f632..b69e694d98 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -303,7 +303,7 @@ static inline void setup_rename_conflict_info(enum rename_type rename_type, return; } - ci = xcalloc(1, sizeof(struct rename_conflict_info)); + CALLOC_ARRAY(ci, 1); ci->rename_type = rename_type; ci->ren1 = ren1; ci->ren2 = ren2; @@ -2389,8 +2389,7 @@ static void compute_collisions(struct hashmap *collisions, continue; collision_ent = collision_find_entry(collisions, new_path); if (!collision_ent) { - collision_ent = xcalloc(1, - sizeof(struct collision_entry)); + CALLOC_ARRAY(collision_ent, 1); hashmap_entry_init(&collision_ent->ent, strhash(new_path)); hashmap_put(collisions, &collision_ent->ent); @@ -2594,7 +2593,7 @@ static struct string_list *get_renames(struct merge_options *opt, struct string_list *renames; compute_collisions(&collisions, dir_renames, pairs); - renames = xcalloc(1, sizeof(struct string_list)); + CALLOC_ARRAY(renames, 1); for (i = 0; i < pairs->nr; ++i) { struct string_list_item *item; @@ -3517,17 +3516,6 @@ static int merge_trees_internal(struct merge_options *opt, return clean; } -static struct commit_list *reverse_commit_list(struct commit_list *list) -{ - struct commit_list *next = NULL, *current, *backup; - for (current = list; current; current = backup) { - backup = current->next; - current->next = next; - next = current; - } - return next; -} - /* * Merge the commits h1 and h2, returning a flag (int) indicating the * cleanness of the merge. Also, if opt->priv->call_depth, create a @@ -3675,7 +3663,7 @@ static int merge_start(struct merge_options *opt, struct tree *head) return -1; } - opt->priv = xcalloc(1, sizeof(*opt->priv)); + CALLOC_ARRAY(opt->priv, 1); string_list_init(&opt->priv->df_conflict_file_set, 1); return 0; } |