提交 a6f63ae0 编写于 作者: M Miklos Vajna 提交者: Junio C Hamano

merge-recursive: get rid of virtual_id

We now just leave the object->sha1 field of virtual commits 0{40} as it
is initialized, as a unique hash is not necessary in case of virtual
commits.
Signed-off-by: NMiklos Vajna <vmiklos@frugalware.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 696ee23c
......@@ -35,18 +35,14 @@ static struct tree *shift_tree_object(struct tree *one, struct tree *two)
}
/*
* A virtual commit has
* - (const char *)commit->util set to the name, and
* - *(int *)commit->object.sha1 set to the virtual id.
* A virtual commit has (const char *)commit->util set to the name.
*/
struct commit *make_virtual_commit(struct tree *tree, const char *comment)
{
struct commit *commit = xcalloc(1, sizeof(struct commit));
static unsigned virtual_id = 1;
commit->tree = tree;
commit->util = (void*)comment;
*(int*)commit->object.sha1 = virtual_id++;
/* avoid warnings */
commit->object.parsed = 1;
return commit;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册