Skip to content

Commit ed04f07

Browse files
committed
Merge pull request #2175 from dscho/difftool-no-index
Allow `git difftool --no-index` to run outside of a worktree
2 parents 2916120 + 26b131b commit ed04f07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/difftool.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -723,16 +723,16 @@ 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);
730733
} else if (dir_diff)
731734
die(_("--dir-diff is incompatible with --no-index"));
732735

733-
if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
734-
die(_("--gui, --tool and --extcmd are mutually exclusive"));
735-
736736
if (use_gui_tool)
737737
setenv("GIT_MERGETOOL_GUI", "true", 1);
738738
else if (difftool_cmd) {

0 commit comments

Comments
 (0)