OSDN Git Service

t0004: fix timing bug
[git-core/git.git] / diff.c
diff --git a/diff.c b/diff.c
index 5262490..78c4d3a 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -153,12 +153,8 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
                diff_auto_refresh_index = git_config_bool(var, value);
                return 0;
        }
-       if (!strcmp(var, "diff.external")) {
-               if (!value)
-                       return config_error_nonbool(var);
-               external_diff_cmd_cfg = xstrdup(value);
-               return 0;
-       }
+       if (!strcmp(var, "diff.external"))
+               return git_config_string(&external_diff_cmd_cfg, var, value);
        if (!prefixcmp(var, "diff.")) {
                const char *ep = strrchr(var, '.');
 
@@ -1150,12 +1146,14 @@ static void checkdiff_consume(void *priv, char *line, unsigned long len)
        char *err;
 
        if (line[0] == '+') {
+               unsigned bad;
                data->lineno++;
-               data->status = check_and_emit_line(line + 1, len - 1,
+               bad = check_and_emit_line(line + 1, len - 1,
                    data->ws_rule, NULL, NULL, NULL, NULL);
-               if (!data->status)
+               if (!bad)
                        return;
-               err = whitespace_error_string(data->status);
+               data->status |= bad;
+               err = whitespace_error_string(bad);
                fprintf(data->file, "%s:%d: %s.\n", data->filename, data->lineno, err);
                free(err);
                emit_line(data->file, set, reset, line, 1);