merge-tree: move logic for existing merge into new function
In preparation for adding a non-trivial merge capability to merge-tree, move the existing merge logic for trivial merges into a new function. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
70176b7015
commit
55e48f6bf7
@ -366,15 +366,12 @@ static void *get_tree_descriptor(struct repository *r,
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmd_merge_tree(int argc, const char **argv, const char *prefix)
|
static int trivial_merge(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct repository *r = the_repository;
|
struct repository *r = the_repository;
|
||||||
struct tree_desc t[3];
|
struct tree_desc t[3];
|
||||||
void *buf1, *buf2, *buf3;
|
void *buf1, *buf2, *buf3;
|
||||||
|
|
||||||
if (argc != 4)
|
|
||||||
usage(merge_tree_usage);
|
|
||||||
|
|
||||||
buf1 = get_tree_descriptor(r, t+0, argv[1]);
|
buf1 = get_tree_descriptor(r, t+0, argv[1]);
|
||||||
buf2 = get_tree_descriptor(r, t+1, argv[2]);
|
buf2 = get_tree_descriptor(r, t+1, argv[2]);
|
||||||
buf3 = get_tree_descriptor(r, t+2, argv[3]);
|
buf3 = get_tree_descriptor(r, t+2, argv[3]);
|
||||||
@ -386,3 +383,10 @@ int cmd_merge_tree(int argc, const char **argv, const char *prefix)
|
|||||||
show_result();
|
show_result();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cmd_merge_tree(int argc, const char **argv, const char *prefix)
|
||||||
|
{
|
||||||
|
if (argc != 4)
|
||||||
|
usage(merge_tree_usage);
|
||||||
|
return trivial_merge(argc, argv);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user