int cmd_merge_file(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
const char *names[3] = { 0 };
mmfile_t mmfs[3] = { 0 };
xmp.style = 0;
xmp.favor = 0;
- if (startup_info->have_repository) {
- /* Read the configuration file */
- repo_config(the_repository, git_xmerge_config, NULL);
- if (0 <= git_xmerge_style)
- xmp.style = git_xmerge_style;
- }
+ /* Read the configuration file */
+ repo_config(repo, git_xmerge_config, NULL);
+ if (0 <= git_xmerge_style)
+ xmp.style = git_xmerge_style;
argc = parse_options(argc, argv, prefix, options, merge_file_usage, 0);
if (argc != 3)
test_cmp expect actual
'
+test_expect_success 'merge.conflictStyle honored outside repo' '
+ test_config_global merge.conflictStyle diff3 &&
+ cat >nongit-base <<-\EOF &&
+ line1
+ original
+ line3
+ EOF
+ cat >nongit-ours <<-\EOF &&
+ line1
+ ours
+ line3
+ EOF
+ cat >nongit-theirs <<-\EOF &&
+ line1
+ theirs
+ line3
+ EOF
+ cat >expect <<-\EOF &&
+ line1
+ <<<<<<< ours
+ ours
+ ||||||| base
+ original
+ =======
+ theirs
+ >>>>>>> theirs
+ line3
+ EOF
+ test_must_fail nongit git merge-file -p \
+ -L ours -L base -L theirs \
+ "$PWD/nongit-ours" \
+ "$PWD/nongit-base" \
+ "$PWD/nongit-theirs" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'marker size' '
cat >expect <<-\EOF &&
Dominus regit me,