Skip to content

Commit 0e97e0b

Browse files
dschoGit for Windows Build Agent
authored andcommitted
TO-RESOLVE
This reflects the merge conflict resolutions with the previous merge commit as rebased from Git for Windows' `master` on top of upstream. Once the conflicting patch series make it to an official Git version, Git for Windows' `master` will need to take these merge conflict resolutions in a more permanent way. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 68b2b0e commit 0e97e0b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

builtin/difftool.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,15 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
723723
if (!no_index && !startup_info->have_repository)
724724
die(_("difftool requires worktree or --no-index"));
725725

726+
if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
727+
die(_("--gui, --tool and --extcmd are mutually exclusive"));
728+
726729
if (!no_index){
727730
setup_work_tree();
728731
setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1);
729732
setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1);
730-
}
733+
} else if (dir_diff)
734+
die(_("--dir-diff is incompatible with --no-index"));
731735

732736
if (use_gui_tool)
733737
setenv("GIT_MERGETOOL_GUI", "true", 1);

t/t7800-difftool.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,17 @@ test_expect_success 'outside worktree' '
726726
echo 2 >2 &&
727727
test_expect_code 1 nongit git \
728728
-c diff.tool=echo -c difftool.echo.cmd="echo \$LOCAL \$REMOTE" \
729-
difftool --no-prompt --no-index --ext-diff ../1 ../2 >actual &&
729+
difftool --no-prompt --no-index ../1 ../2 >actual &&
730730
echo "../1 ../2" >expect &&
731731
test_cmp expect actual
732732
'
733733

734+
test_expect_success 'difftool --gui, --tool and --extcmd are exclusive' '
735+
difftool_test_setup &&
736+
test_must_fail git difftool --gui --tool=test-tool &&
737+
test_must_fail git difftool --gui --extcmd=cat &&
738+
test_must_fail git difftool --tool=test-tool --extcmd=cat &&
739+
test_must_fail git difftool --gui --tool=test-tool --extcmd=cat
740+
'
741+
734742
test_done

0 commit comments

Comments
 (0)