summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-04-29 06:21:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-13 14:11:59 (GMT)
commit6c22d715e7b4067a6865ff3fbceab991d0042c12 (patch)
tree9d8f81d3a69a7b3f7924ff35e91f6af0da7f4b7d /builtin
parent7f978d7d10a87c4a56ea3101b936cddb25bbe2c6 (diff)
downloadgit-6c22d715e7b4067a6865ff3fbceab991d0042c12.zip
git-6c22d715e7b4067a6865ff3fbceab991d0042c12.tar.gz
git-6c22d715e7b4067a6865ff3fbceab991d0042c12.tar.bz2
difftool: fallback on merge.guitool
In git-difftool.txt, it says 'git difftool' falls back to 'git mergetool' config variables when the difftool equivalents have not been defined. However, when `diff.guitool` is missing, it doesn't fallback to anything. Make git-difftool fallback to `merge.guitool` when `diff.guitool` is missing. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/difftool.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 481aa64..2205de1 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -23,7 +23,6 @@
#include "object-store.h"
#include "dir.h"
-static char *diff_gui_tool;
static int trust_exit_code;
static const char *const builtin_difftool_usage[] = {
@@ -33,11 +32,6 @@ static const char *const builtin_difftool_usage[] = {
static int difftool_config(const char *var, const char *value, void *cb)
{
- if (!strcmp(var, "diff.guitool")) {
- diff_gui_tool = xstrdup(value);
- return 0;
- }
-
if (!strcmp(var, "difftool.trustexitcode")) {
trust_exit_code = git_config_bool(var, value);
return 0;
@@ -733,8 +727,8 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
die(_("--gui, --tool and --extcmd are mutually exclusive"));
- if (use_gui_tool && diff_gui_tool && *diff_gui_tool)
- setenv("GIT_DIFF_TOOL", diff_gui_tool, 1);
+ if (use_gui_tool)
+ setenv("GIT_MERGETOOL_GUI", "true", 1);
else if (difftool_cmd) {
if (*difftool_cmd)
setenv("GIT_DIFF_TOOL", difftool_cmd, 1);