@matheusbsbs / matheus-bagliano / commits / a6f63ae002
Fork 0

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: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Miklos Vajna committed Sep 5, 2008 at 19:26 UTC a6f63ae002237c2eb416d4e2cb43227522e4ea9a
1 file changed +1 -5
merge-recursive.c
+1 -5
@@ -35,18 +35,14 @@ static struct tree *shift_tree_object(struct tree *one, struct tree *two)
35 }
36
37 /*
38 - * A virtual commit has
39 - * - (const char *)commit->util set to the name, and
40 - * - *(int *)commit->object.sha1 set to the virtual id.
38 + * A virtual commit has (const char *)commit->util set to the name.
39 */
40
41 struct commit *make_virtual_commit(struct tree *tree, const char *comment)
42 {
43 struct commit *commit = xcalloc(1, sizeof(struct commit));
46 - static unsigned virtual_id = 1;
44 commit->tree = tree;
45 commit->util = (void*)comment;
49 - *(int*)commit->object.sha1 = virtual_id++;
46 /* avoid warnings */
47 commit->object.parsed = 1;
48 return commit;