diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2014-01-08 18:29:42 -0800 |
|---|---|---|
| committer | Edward Thomson <ethomson@microsoft.com> | 2014-01-20 17:15:11 -0500 |
| commit | c1d648c5c6361edfb1aa85a31656b628672c7616 (patch) | |
| tree | f611ff05206f2305c82867514f1e7f22b602c7b7 /src/checkout.c | |
| parent | e49c98e6efaa444ed73ac3b8318a693801f93184 (diff) | |
| download | libgit2-c1d648c5c6361edfb1aa85a31656b628672c7616.tar.gz | |
merge_file should use more aggressive levels
The default merge_file level was XDL_MERGE_MINIMAL, which will
produce conflicts where there should not be in the case where
both sides were changed identically. Change the defaults to be
more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively
compress non-conflicts. This matches git.git's defaults.
Increase testing around reverting a previously reverted commit to
illustrate this problem.
Diffstat (limited to 'src/checkout.c')
| -rw-r--r-- | src/checkout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c index e642c975e..cc49800a2 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -1626,6 +1626,7 @@ static int checkout_write_merge( { git_buf our_label = GIT_BUF_INIT, their_label = GIT_BUF_INIT, path_suffixed = GIT_BUF_INIT, path_workdir = GIT_BUF_INIT; + git_merge_file_options merge_file_opts = GIT_MERGE_FILE_OPTIONS_INIT; git_merge_file_input ancestor = GIT_MERGE_FILE_INPUT_INIT, ours = GIT_MERGE_FILE_INPUT_INIT, theirs = GIT_MERGE_FILE_INPUT_INIT; @@ -1662,7 +1663,7 @@ static int checkout_write_merge( theirs.label = git_buf_cstr(&their_label); } - if ((error = git_merge_files(&result, &ancestor, &ours, &theirs, 0)) < 0) + if ((error = git_merge_files(&result, &ancestor, &ours, &theirs, &merge_file_opts)) < 0) goto done; if (result.path == NULL || result.mode == 0) { |
