use get_cached_commit_buffer where appropriate
[gitweb.git] / builtin / blame.c
index 88cb7997274de6f9ab6f8a5944748334ce605f60..38784ab9d6714400cbb7e7c555ef5a19376d307e 100644 (file)
@@ -1405,7 +1405,7 @@ static void get_commit_info(struct commit *commit,
 {
        int len;
        const char *subject, *encoding;
-       char *message;
+       const char *message;
 
        commit_info_init(ret);
 
@@ -2019,7 +2019,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
        struct strbuf msg = STRBUF_INIT;
 
        time(&now);
-       commit = xcalloc(1, sizeof(*commit));
+       commit = alloc_commit_node();
        commit->object.parsed = 1;
        commit->date = now;
        commit->object.type = OBJ_COMMIT;
@@ -2046,7 +2046,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
                    ident, ident, path,
                    (!contents_from ? path :
                     (!strcmp(contents_from, "-") ? "standard input" : contents_from)));
-       commit->buffer = strbuf_detach(&msg, NULL);
+       set_commit_buffer(commit, strbuf_detach(&msg, NULL));
 
        if (!contents_from || strcmp("-", contents_from)) {
                struct stat st;