summaryrefslogtreecommitdiff
path: root/t/t4108-apply-threeway.sh
AgeCommit message (Collapse)AuthorFilesLines
2019-10-24apply: respect merge.conflictStyle in --3wayLibravatar Denton Liu1-1/+1
Before, when doing a 3-way merge, the merge.conflictStyle option was not respected and the "merge" style was always used, even if "diff3" was specified. Call git_xmerge_config() at the end of git_apply_config() so that the merge.conflictStyle config is read. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-24t4108: demonstrate bug in applyLibravatar Denton Liu1-2/+11
Currently, apply does not respect the merge.conflictStyle setting. Demonstrate this by making the 'apply with --3way' test case generic and extending it to show that the configuration of merge.conflictStyle = diff3 causes a breakage. Change print_sanitized_conflicted_diff() to also sanitize `|||||||` conflict markers. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-24t4108: use `test_config` instead of `git config`Libravatar Denton Liu1-1/+1
Since `git config` leaves the configurations set even after the test case completes, use `test_config` instead so that the configurations are reset once the test case finishes. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-24t4108: remove git command upstream of pipeLibravatar Denton Liu1-6/+7
Before, the output of `git diff HEAD` would always be piped to sanitize_conflicted_diff(). However, since the Git command was upstream of the pipe, in case the Git command fails, the return code would be lost. Rewrite into separate statements so that the return code is no longer lost. Since only the command `git diff HEAD` was being piped to sanitize_conflicted_diff(), move the command into the function and rename it to print_sanitized_conflicted_diff(). Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-24t4108: replace create_file with test_write_linesLibravatar Denton Liu1-17/+10
Since the locally defined create_file() duplicates the functionality of the test_write_lines() helper function, remove create_file() and replace all instances with test_write_lines(). While we're at it, move redirection operators to the end of the command which is the more conventional place to put it. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: tests for the --3way optionLibravatar Junio C Hamano1-0/+54
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: allow rerere() to work on --3way resultsLibravatar Junio C Hamano1-0/+25
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: register conflicted stages to the indexLibravatar Junio C Hamano1-0/+78
Now we have all the necessary logic to fall back on three-way merge when the patch does not cleanly apply, insert the conflicted entries to the index as appropriate. This obviously triggers only when the "--index" option is used. When we fall back to three-way merge and some of the merges fail, just like the case where the "--reject" option was specified and we had to write some "*.rej" files out for unapplicable patches, exit the command with non-zero status without showing the diffstat and summary. Otherwise they would make the list of problematic paths scroll off the display. Signed-off-by: Junio C Hamano <gitster@pobox.com>