https://github.com/git/git
Revision eeed979e6a13b60667c856dc3418a14f67607875 authored by Junio C Hamano on 18 October 2017, 05:19:14 UTC, committed by Junio C Hamano on 18 October 2017, 05:19:14 UTC
Leakfix and futureproofing.

* jk/sha1-loose-object-info-fix:
  sha1_loose_object_info: handle errors from unpack_sha1_rest
2 parent s a116022 + b3ea7dd
Raw File
Tip revision: eeed979e6a13b60667c856dc3418a14f67607875 authored by Junio C Hamano on 18 October 2017, 05:19:14 UTC
Merge branch 'jk/sha1-loose-object-info-fix' into maint
Tip revision: eeed979
blob.c
#include "cache.h"
#include "blob.h"

const char *blob_type = "blob";

struct blob *lookup_blob(const struct object_id *oid)
{
	struct object *obj = lookup_object(oid->hash);
	if (!obj)
		return create_object(oid->hash, alloc_blob_node());
	return object_as_type(obj, OBJ_BLOB, 0);
}

int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
{
	item->object.parsed = 1;
	return 0;
}
back to top