Merge branch 'js/rebase-helper'
[gitweb.git] / builtin / difftool.c
index 42ad9e804aa65ee6397a58ea853bb6510fd71918..d13350ce832cd8c0064c8a5b2d3c9be64f876b8d 100644 (file)
@@ -567,7 +567,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
                                warning(_("both files modified: '%s' and '%s'."),
                                        wtdir.buf, rdir.buf);
                                warning(_("working tree file has been left."));
-                               warning("");
+                               warning("%s", "");
                                err = 1;
                        } else if (unlink(wtdir.buf) ||
                                   copy_file(wtdir.buf, rdir.buf, st.st_mode))
@@ -647,10 +647,6 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
-       /* NEEDSWORK: once we no longer spawn anything, remove this */
-       setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1);
-       setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1);
-
        git_config(difftool_config, NULL);
        symlinks = has_symlinks;
 
@@ -661,6 +657,10 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
        if (tool_help)
                return print_tool_help();
 
+       /* NEEDSWORK: once we no longer spawn anything, remove this */
+       setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1);
+       setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1);
+
        if (use_gui_tool && diff_gui_tool && *diff_gui_tool)
                setenv("GIT_DIFF_TOOL", diff_gui_tool, 1);
        else if (difftool_cmd) {