if (strbuf_read(&buf, 0, 0) < 0)
die_errno("failed to read from stdin");
}
- convert_to_git(path, buf.buf, buf.len, &buf, 0);
+ convert_to_git(&the_index, path, buf.buf, buf.len, &buf, 0);
origin->file.ptr = buf.buf;
origin->file.size = buf.len;
pretend_sha1_file(buf.buf, buf.len, OBJ_BLOB, origin->blob_oid.hash);
static void drop_origin_blob(struct blame_origin *o)
{
if (o->file.ptr) {
- free(o->file.ptr);
- o->file.ptr = NULL;
+ FREE_AND_NULL(o->file.ptr);
}
}
name = revs->pending.objects[i].name;
}
if (name_p)
- *name_p = name;
+ *name_p = xstrdup_or_null(name);
return found;
}
die("No commit to dig up from?");
if (name_p)
- *name_p = name;
+ *name_p = xstrdup(name);
return found;
}
if (orig)
*orig = o;
+
+ free((char *)final_commit_name);
}