Merge branch 'mg/branch-list'
[gitweb.git] / builtin / revert.c
index 8409f4c886aeb23b4d0d5d000661eb3e2c278558..ba27cf15ee5478981a0a9a53493f41b67fcf9440 100644 (file)
@@ -339,12 +339,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 int error_dirty_index(struct replay_opts *opts)