]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff.c
The second batch post 2.26 cycle
[thirdparty/git.git] / diff.c
diff --git a/diff.c b/diff.c
index 8e2914c0312ce7004c6b6ce3ab4b84b846630d65..1010d806f50dac47927f6f70125647e9bf8276ef 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -414,14 +414,6 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       if (!strcmp(var, "diff.wserrorhighlight")) {
-               int val = parse_ws_error_highlight(value);
-               if (val < 0)
-                       return -1;
-               ws_error_highlight_default = val;
-               return 0;
-       }
-
        if (git_color_config(var, value, cb) < 0)
                return -1;
 
@@ -450,6 +442,14 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
                return color_parse(value, diff_colors[slot]);
        }
 
+       if (!strcmp(var, "diff.wserrorhighlight")) {
+               int val = parse_ws_error_highlight(value);
+               if (val < 0)
+                       return -1;
+               ws_error_highlight_default = val;
+               return 0;
+       }
+
        /* like GNU diff's --suppress-blank-empty option  */
        if (!strcmp(var, "diff.suppressblankempty") ||
                        /* for backwards compatibility */
@@ -4024,7 +4024,7 @@ int diff_populate_filespec(struct repository *r,
                                return 0;
                        }
                }
-               s->data = read_object_file(&s->oid, &type, &s->size);
+               s->data = repo_read_object_file(r, &s->oid, &type, &s->size);
                if (!s->data)
                        die("unable to read %s", oid_to_hex(&s->oid));
                s->should_free = 1;
@@ -4062,6 +4062,9 @@ static void prep_temp_blob(struct index_state *istate,
        struct strbuf tempfile = STRBUF_INIT;
        char *path_dup = xstrdup(path);
        const char *base = basename(path_dup);
+       struct checkout_metadata meta;
+
+       init_checkout_metadata(&meta, NULL, NULL, oid);
 
        /* Generate "XXXXXX_basename.ext" */
        strbuf_addstr(&tempfile, "XXXXXX_");
@@ -4071,7 +4074,7 @@ static void prep_temp_blob(struct index_state *istate,
        if (!temp->tempfile)
                die_errno("unable to create temp-file");
        if (convert_to_working_tree(istate, path,
-                       (const char *)blob, (size_t)size, &buf)) {
+                       (const char *)blob, (size_t)size, &buf, &meta)) {
                blob = buf.buf;
                size = buf.len;
        }