X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Frevert.c;h=3117776c2c030bec03563f043c4dc8bb34eb17cd;hb=1a61a9dae874cac9ea40ac63f8fd662f62eee97e;hp=1f27c63343904a969e60ab19408495007f59d133;hpb=3fc44a10f62fdca29558dc553a3e12949af30637;p=git.git diff --git a/builtin/revert.c b/builtin/revert.c index 1f27c6334..3117776c2 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -258,12 +258,7 @@ static void write_message(struct strbuf *msgbuf, const char *filename) static struct tree *empty_tree(void) { - struct tree *tree = xcalloc(1, sizeof(struct tree)); - - tree->object.parsed = 1; - tree->object.type = OBJ_TREE; - pretend_sha1_file(NULL, 0, OBJ_TREE, tree->object.sha1); - return tree; + return lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN); } static NORETURN void die_dirty_index(const char *me)