X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Fmerge-file.c;h=b6664d49be9454b703615af4e71f92231e053e07;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=69cc683332a04ddc6959fcef3d2853ccfb2860b8;hpb=faf752693abd0a891a9a47a2d398353cc59ee93a;p=git.git diff --git a/builtin/merge-file.c b/builtin/merge-file.c index 69cc68333..b6664d49b 100644 --- a/builtin/merge-file.c +++ b/builtin/merge-file.c @@ -25,10 +25,9 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix) const char *names[3] = { NULL, NULL, NULL }; mmfile_t mmfs[3]; mmbuffer_t result = {NULL, 0}; - xmparam_t xmp = {{XDF_NEED_MINIMAL}}; + xmparam_t xmp = {{0}}; int ret = 0, i = 0, to_stdout = 0; int quiet = 0; - int nongit; struct option options[] = { OPT_BOOLEAN('p', "stdout", &to_stdout, "send results to standard output"), OPT_SET_INT(0, "diff3", &xmp.style, "use a diff3 based merge", XDL_MERGE_DIFF3), @@ -50,8 +49,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix) xmp.style = 0; xmp.favor = 0; - prefix = setup_git_directory_gently(&nongit); - if (!nongit) { + if (startup_info->have_repository) { /* Read the configuration file */ git_config(git_xmerge_config, NULL); if (0 <= git_xmerge_style) @@ -77,8 +75,10 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix) argv[i]); } - ret = xdl_merge(mmfs + 1, mmfs + 0, names[0], mmfs + 2, names[2], - &xmp, &result); + xmp.ancestor = names[1]; + xmp.file1 = names[0]; + xmp.file2 = names[2]; + ret = xdl_merge(mmfs + 1, mmfs + 0, mmfs + 2, &xmp, &result); for (i = 0; i < 3; i++) free(mmfs[i].ptr);