summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b3f5da)
raw | patch | inline | side by side (parent: 7b3f5da)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Thu, 27 Jul 2006 17:13:47 +0000 (19:13 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 28 Jul 2006 02:39:15 +0000 (19:39 -0700) |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
merge-recursive.c | patch | blob | history |
diff --git a/merge-recursive.c b/merge-recursive.c
index 1a21ff30255ad42bf03b26780a2984eb1326eb0f..eda4feea0fe8f5c8ca661f16f59b2a5398e23f61 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
static struct merge_file_info merge_file(struct diff_filespec *o,
struct diff_filespec *a, struct diff_filespec *b,
- const char *branch1Name, const char *branch2Name)
+ const char *branch1, const char *branch2)
{
struct merge_file_info result;
result.merge = 0;
git_unpack_file(a->sha1, src1);
git_unpack_file(b->sha1, src2);
- argv[2] = la = strdup(mkpath("%s/%s", branch1Name, a->path));
- argv[6] = lb = strdup(mkpath("%s/%s", branch2Name, b->path));
+ argv[2] = la = strdup(mkpath("%s/%s", branch1, a->path));
+ argv[6] = lb = strdup(mkpath("%s/%s", branch2, b->path));
argv[4] = lo = strdup(mkpath("orig/%s", o->path));
argv[7] = src1;
argv[8] = orig;
/* Per entry merge function */
static int process_entry(const char *path, struct stage_data *entry,
- const char *branch1Name,
- const char *branch2Name)
+ const char *branch1,
+ const char *branch2)
{
/*
printf("processing entry, clean cache: %s\n", index_only ? "yes": "no");
if (!a_sha) {
output("CONFLICT (delete/modify): %s deleted in %s "
"and modified in %s. Version %s of %s left in tree.",
- path, branch1Name,
- branch2Name, branch2Name, path);
+ path, branch1,
+ branch2, branch2, path);
update_file(0, b_sha, b_mode, path);
} else {
output("CONFLICT (delete/modify): %s deleted in %s "
"and modified in %s. Version %s of %s left in tree.",
- path, branch2Name,
- branch1Name, branch1Name, path);
+ path, branch2,
+ branch1, branch1, path);
update_file(0, a_sha, a_mode, path);
}
}
const char *conf;
if (a_sha) {
- add_branch = branch1Name;
- other_branch = branch2Name;
+ add_branch = branch1;
+ other_branch = branch2;
mode = a_mode;
sha = a_sha;
conf = "file/directory";
} else {
- add_branch = branch2Name;
- other_branch = branch1Name;
+ add_branch = branch2;
+ other_branch = branch1;
mode = b_mode;
sha = b_sha;
conf = "directory/file";
} else {
const char *new_path1, *new_path2;
clean_merge = 0;
- new_path1 = unique_path(path, branch1Name);
- new_path2 = unique_path(path, branch2Name);
+ new_path1 = unique_path(path, branch1);
+ new_path2 = unique_path(path, branch2);
output("CONFLICT (add/add): File %s added non-identically "
"in both branches. Adding as %s and %s instead.",
path, new_path1, new_path2);
b.mode = b_mode;
mfi = merge_file(&o, &a, &b,
- branch1Name, branch2Name);
+ branch1, branch2);
if (mfi.clean)
update_file(1, mfi.sha, mfi.mode, path);
static int merge_trees(struct tree *head,
struct tree *merge,
struct tree *common,
- const char *branch1Name,
- const char *branch2Name,
+ const char *branch1,
+ const char *branch2,
struct tree **result)
{
int code, clean;
re_head = get_renames(head, common, head, merge, entries);
re_merge = get_renames(merge, common, head, merge, entries);
clean = process_renames(re_head, re_merge,
- branch1Name, branch2Name);
+ branch1, branch2);
for (i = 0; i < entries->nr; i++) {
const char *path = entries->items[i].path;
struct stage_data *e = entries->items[i].util;
if (e->processed)
continue;
- if (!process_entry(path, e, branch1Name, branch2Name))
+ if (!process_entry(path, e, branch1, branch2))
clean = 0;
}
static
int merge(struct commit *h1,
struct commit *h2,
- const char *branch1Name,
- const char *branch2Name,
+ const char *branch1,
+ const char *branch2,
int call_depth /* =0 */,
struct commit *ancestor /* =None */,
struct commit **result)
}
clean = merge_trees(h1->tree, h2->tree, merged_common_ancestors->tree,
- branch1Name, branch2Name, &mrtree);
+ branch1, branch2, &mrtree);
if (!ancestor && (clean || index_only)) {
*result = make_virtual_commit(mrtree, "merged tree");