sha1-name.c: remove implicit dependency on the_index
[gitweb.git] / builtin / log.c
index 5ac18e28486b61b91239d859c445bc620c51c5ad..dbfb4e31ad7e031d41ef2b9718336c788a96e806 100644 (file)
@@ -508,7 +508,8 @@ static int show_blob_object(const struct object_id *oid, struct rev_info *rev, c
            !rev->diffopt.flags.allow_textconv)
                return stream_blob_to_fd(1, oid, NULL, 0);
 
-       if (get_oid_with_context(obj_name, GET_OID_RECORD_PATH,
+       if (get_oid_with_context(the_repository, obj_name,
+                                GET_OID_RECORD_PATH,
                                 &oidc, &obj_context))
                die(_("Not a valid object name %s"), obj_name);
        if (!obj_context.path ||
@@ -1094,9 +1095,18 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
        }
 
        if (rev->rdiff1) {
+               /*
+                * Pass minimum required diff-options to range-diff; others
+                * can be added later if deemed desirable.
+                */
+               struct diff_options opts;
+               diff_setup(&opts);
+               opts.file = rev->diffopt.file;
+               opts.use_color = rev->diffopt.use_color;
+               diff_setup_done(&opts);
                fprintf_ln(rev->diffopt.file, "%s", rev->rdiff_title);
                show_range_diff(rev->rdiff1, rev->rdiff2,
-                               rev->creation_factor, 1, NULL);
+                               rev->creation_factor, 1, &opts);
        }
 }