return lookup_tree(repo, &shifted);
}
+static inline void set_commit_tree(struct commit *c, struct tree *t)
+{
+ c->maybe_tree = t;
+}
+
static struct commit *make_virtual_commit(struct repository *repo,
struct tree *tree,
const char *comment)
struct commit *commit = alloc_commit_node(repo);
set_merge_remote_desc(commit, comment, (struct object *)commit);
- commit->maybe_tree = tree;
+ set_commit_tree(commit, tree);
commit->object.parsed = 1;
return commit;
}
static int handle_rename_via_dir(struct merge_options *o,
struct diff_filepair *pair,
- const char *rename_branch,
- const char *other_branch)
+ const char *rename_branch)
{
/*
* Handle file adds that need to be renamed due to directory rename
remove_hashmap_entries(dir_re_merge, &remove_from_merge);
}
-static struct hashmap *get_directory_renames(struct diff_queue_struct *pairs,
- struct tree *tree)
+static struct hashmap *get_directory_renames(struct diff_queue_struct *pairs)
{
struct hashmap *dir_renames;
struct hashmap_iter iter;
struct tree *o_tree,
struct tree *a_tree,
struct tree *b_tree,
- struct string_list *entries,
- int *clean)
+ struct string_list *entries)
{
struct string_list_item *item;
int stage = (tree == a_tree ? 2 : 3);
apply_directory_rename_modifications(o, pair, new_path,
re, tree, o_tree,
a_tree, b_tree,
- entries,
- clean_merge);
+ entries);
}
hashmap_iter_init(&collisions, &iter);
merge_pairs = get_diffpairs(o, common, merge);
if (o->detect_directory_renames) {
- dir_re_head = get_directory_renames(head_pairs, head);
- dir_re_merge = get_directory_renames(merge_pairs, merge);
+ dir_re_head = get_directory_renames(head_pairs);
+ dir_re_merge = get_directory_renames(merge_pairs);
handle_directory_level_conflicts(o,
dir_re_head, head,
clean_merge = 1;
if (handle_rename_via_dir(o,
conflict_info->pair1,
- conflict_info->branch1,
- conflict_info->branch2))
+ conflict_info->branch1))
clean_merge = -1;
break;
case RENAME_ADD:
return -1;
o->merge_detect_rename = 1;
}
+ /*
+ * Please update $__git_merge_strategy_options in
+ * git-completion.bash when you add new options
+ */
else
return -1;
return 0;