merge-file: clamp exit code to maximum 127
[gitweb.git] / builtin / blame.c
index ef7cb1d254118afa3f241c5ae4236f3b57dda659..eefd6bc2e1576cf9a113fbeac11945458899c110 100644 (file)
@@ -2041,7 +2041,6 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
        commit = alloc_commit_node();
        commit->object.parsed = 1;
        commit->date = now;
-       commit->object.type = OBJ_COMMIT;
        parent_tail = &commit->parents;
 
        if (!resolve_ref_unsafe("HEAD", head_sha1, 1, NULL))
@@ -2458,11 +2457,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
                die("revision walk setup failed");
 
        if (is_null_sha1(sb.final->object.sha1)) {
-               char *buf;
                o = sb.final->util;
-               buf = xmalloc(o->file.size + 1);
-               memcpy(buf, o->file.ptr, o->file.size + 1);
-               sb.final_buf = buf;
+               sb.final_buf = xmemdupz(o->file.ptr, o->file.size);
                sb.final_buf_size = o->file.size;
        }
        else {