Revision a64fe6c1d5949492857e1a5ad14d60175dd484fa authored by Junio C Hamano on 28 July 2012, 04:13:46 UTC, committed by Junio C Hamano on 28 July 2012, 04:13:46 UTC
In a superproject that has repository outside of its working tree,
"git submodule add" failed to clone a new submodule, as GIT_DIR and
GIT_WORK_TREE environment variables necessary to work in such a
superproject interfered with access to the submodule repository.

* dg/submodule-in-dismembered-working-tree:
  git-submodule: work with GIT_DIR/GIT_WORK_TREE
2 parent s 5000caa + be8779f
Raw File
blob.c
#include "cache.h"
#include "blob.h"

const char *blob_type = "blob";

struct blob *lookup_blob(const unsigned char *sha1)
{
	struct object *obj = lookup_object(sha1);
	if (!obj)
		return create_object(sha1, OBJ_BLOB, alloc_blob_node());
	if (!obj->type)
		obj->type = OBJ_BLOB;
	if (obj->type != OBJ_BLOB) {
		error("Object %s is a %s, not a blob",
		      sha1_to_hex(sha1), typename(obj->type));
		return NULL;
	}
	return (struct blob *) obj;
}

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